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'sGetStreamStatusmethod and checking thekCDDataAvailableflag. If thekCDDataAvailableflag 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
GetBufferto 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 toGetBuffercannot be completed, the method sets the value ofbuffertokODNULLand the value ofbufferSizeto 0.When you call
GetStreamStatusand the value of thekCDDownloadCompleteflag istrue, you have retrieved all of the data and you do not need to callGetBufferagain. You release a buffer when you have finished using it by calling theReleaseBuffermethod.
GetBuffermay 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
TheStreamStatustype (page 179).
TheReleaseBuffermethod (page 389).
TheGetStreamStatusmethod (page 385).
 
  
  
 