#ifndef FBCBlobStream__H
#define FBCBlobStream__H

/*
**  Opens (allocates) a blob stream.  Caller is responsible for freeing
**  the stream by calling fbcbsClose().  This does not close or free
**  the blob handle or database connection.
*/
FBCBlobStream *fbcbsOpen(FBCDatabaseConnection *fbdc, FBCBlobHandle *blobHandle);

/*
**  Reads a chunk of data from a blob stream, starting at offset, up to
**  chunkSize (bytes actually read can be less than chunkSize if
**  end-of-blob is encountered).  chunkSize will be updated with the
**  number of bytes actually read.
*/
void *fbcbsReadBLOBChunk(FBCBlobStream *self, FSUSize offset, FSUSize *chunkSize, void *chunkBuffer);

/*
**  Get and set the internal buffer size for new blob streams.
**  The default buffer size is 64K.
*/file://localhost/Users/sb/FrontBase/5/Client/FBCAccess/FBCBlobStream.h
unsigned fbcbsGetStreamBufferSize(void);
void fbcbsSetStreamBufferSize(FSUSize nbytes);

/*
**  Get the blob handle associated with a blob stream.
*/
FBCBlobHandle *fbcbsGetBlobHandle(FBCBlobStream *self);

/*
**  Close (free) the blob stream.
*/
void fbcbsClose(FBCBlobStream *self);

#endif /* FBCBlobStream__H */

