Subject Re: Resettable FBBlobInputStream?
Author Roman Rokytskyy
> It isn't possible to seek back?

You have to check this. This seems to be more correct way of doing things.

> If not, maybe I could just make an
> input stream that wraps the current FBBlobInputStream stream (or
> just the blob). If a mark/reset is made, I can just open a new blob
> and discard the old handle. Do you think that would work?

Yes, it will. But I see no reason to wrap FBBlobInputStream. I would
add reset() method as:

public void reset() throws IOException {
close();
openHandle();
}

where openHandle() is the code from constructor:

private void openHandle() throws IOException {
closed = false;

if (isNew) {
throw new SQLException("You can't read a new blob");
}

Object syncObject = getSynchronizationObject();

synchronized(syncObject) {
try {
blob = c.openBlobHandle(blob_id, SEGMENTED);
} catch (GDSException ge) {
throw new FBSQLException(ge);
}
}
}

Also you can add position tracking and do seek(...) after openHandle().

And be sure to add mark()/reset() to FirebirdBlob.BlobInputStream
interface.

Roman