j16706
1 Copper

Terminating a generic stream without an error

I'm trying to perform a blob read via a generic stream (SDK3.3) and in some cases I would like to terminate the stream before all of the data has been read.  Is there any method of terminating the stream other than forcing an error. The programmers guide suggests setting pStreamInfo->mStreamPos=0 and returning with a non-zero return code.  I would prefer a solution that didn't throw an error.

0 Kudos
1 Reply
8 Krypton

Re: Terminating a generic stream without an error

The few, the brave, the Centera Generic Stream API users!

It's been a very long time since I looked at this, but I don't think it's possible to accomplish your goal without throwing an error in the case of an aborted read.  You could try 'jumping' the stream forward and setting the position to the last byte, then just returning a single null byte in the buffer. But of course your application will have to understand this behavior (stream say it returned X bytes but the app only saw X-Y).

Good luck and please let us know how this turns out.

Best Regards,

Mike Horgan

0 Kudos