SofaStreamHandler
defines the API methods that must be implemented to support reading custom URI schemes for reading. Public Member Functions | |
SofaStreamHandler (void) | |
Constructor. | |
virtual | ~SofaStreamHandler () |
Destructor. | |
virtual void | openStream (const char *uriString)=0 |
Open a stream to this URL. | |
virtual void | openStream (const char *uriString, size_t minimumBufferSize)=0 |
Open a stream to this URL and specify the minimum size of the internal buffer. | |
virtual INT64 | getTotalStreamSize ()=0 |
Gets the total size of the data in bytes. | |
virtual size_t | getBufferSize ()=0 |
Gets the size of the internal buffer. | |
virtual INT64 | howManyAvailable ()=0 |
Gets number of bytes available to read. | |
virtual INT64 | getNext (size_t numBytes, void *pBuffer)=0 |
Read the specified number of bytes from the current position. | |
virtual int | seek (INT64 offset, int origin)=0 |
Sets the position within the current stream. | |
virtual void | closeStream ()=0 |
closeStream close the stream. | |
virtual void * | getDataPointer () |
getDataPointer This returns a pointer to the data in memory. |
uima::SofaStreamHandler::SofaStreamHandler | ( | void | ) | [inline] |
Constructor.
virtual uima::SofaStreamHandler::~SofaStreamHandler | ( | ) | [inline, virtual] |
Destructor.
virtual void uima::SofaStreamHandler::openStream | ( | const char * | uriString | ) | [pure virtual] |
Open a stream to this URL.
virtual void uima::SofaStreamHandler::openStream | ( | const char * | uriString, | |
size_t | minimumBufferSize | |||
) | [pure virtual] |
Open a stream to this URL and specify the minimum size of the internal buffer.
virtual INT64 uima::SofaStreamHandler::getTotalStreamSize | ( | ) | [pure virtual] |
Gets the total size of the data in bytes.
virtual size_t uima::SofaStreamHandler::getBufferSize | ( | ) | [pure virtual] |
Gets the size of the internal buffer.
virtual INT64 uima::SofaStreamHandler::howManyAvailable | ( | ) | [pure virtual] |
Gets number of bytes available to read.
virtual INT64 uima::SofaStreamHandler::getNext | ( | size_t | numBytes, | |
void * | pBuffer | |||
) | [pure virtual] |
Read the specified number of bytes from the current position.
Advance the current position by the number of bytes read. This call blocks till read request is satisfied or EOF is reached.
numBytes | the number of bytes to read | |
pBuffer | buffer into which the bytes are to be copied. |
virtual int uima::SofaStreamHandler::seek | ( | INT64 | offset, | |
int | origin | |||
) | [pure virtual] |
Sets the position within the current stream.
offset | - number of bytes from origin | |
origin | is one of the following (taken from lseek spec): If SEEK_SET, the position is set to offset bytes. If SEEK_CUR, the position is set to its current location plus offset bytes. If SEEK_END, the position is set to the total length plus offset bytes. These constants are defined in stdio.h |
virtual void uima::SofaStreamHandler::closeStream | ( | ) | [pure virtual] |
closeStream close the stream.
Delete the internal buffer.
void * uima::SofaStreamHandler::getDataPointer | ( | ) | [inline, virtual] |
getDataPointer This returns a pointer to the data in memory.
A valid pointer is returned only if the entire stream data is available in memory, that is getTotalLength() is equal to howManyAvailable(). Otherwise return NULL.