Important: The information in this document is obsolete and should not be used for new development.
GetBuffer
Retrieves a buffer from this Cyberdog stream.
void GetBuffer (in Ptr* buffer, in Size* bufferSize);
buffer
- A pointer to a pointer to a memory buffer. On return, the buffer contains the downloaded data.
bufferSize
- A pointer to the length of the buffer. On return, the length is set to the number of bytes in the buffer.
DISCUSSION
Each stream object has memory buffers to hold incoming data. You determine whether a stream object has data available by calling the stream'sGetStreamStatus
method and checking thekCDDataAvailable
flag. If thekCDDataAvailable
flag is set, the stream has been opened successfully and there is at least one buffer of non-zero length available.When the stream object has data available, you can call
GetBuffer
to retrieve a buffer from the stream. The contents of the buffer are read only; you cannot modify them. You can retrieve more than one buffer at a time. If the call toGetBuffer
cannot be completed, the method sets the value ofbuffer
tokODNULL
and the value ofbufferSize
to 0.When you call
GetStreamStatus
and the value of thekCDDownloadComplete
flag istrue
, you have retrieved all of the data and you do not need to callGetBuffer
again. You release a buffer when you have finished using it by calling theReleaseBuffer
method.
GetBuffer
may be called at interrupt time.If you subclass
CyberStream
, you must override this method. Your override must not call its inherited method; that is, your override method must implement this method's functionality completely.SEE ALSO
TheStreamStatus
type (page 179).
TheReleaseBuffer
method (page 389).
TheGetStreamStatus
method (page 385).