Inherits from: MTBuffer
An MTByteBuffer is a thread-safe, flow-controlled, fixed-size byte buffer. In other words, it is a concrete subclass of MTBuffer where each abstract frame is one byte. It is intended to be used as a producer/consumer conduit for arbitrary, byte-oriented data where each of producer and consumer may be batch-oriented or time-constrained.
- (unsigned) capacity
- (unsigned) count
- (void) flush
- (id) initWithCapacity:(unsigned)capacity
- (unsigned) readToBytes:(void *)theBytes count:(unsigned)count waitForData:(Boolean)wait
NO
,
then a maximum of
[receiver count] bytes will be copied immediately. If wait is YES
,
then exactly count bytes will be copied, and this method will pause if necessary until enough data
has been written into the buffer by
writeFromBytes:count:waitForRoom: to supply the request.
Returns the number of bytes copied.
- (unsigned) writeFromBytes:(void *)theBytes count:(unsigned)count waitForRoom:(Boolean)wait
NO
,
then a maximum of
capacity minus [receiver count] bytes will be
copied immediately. If wait is YES
, then exactly count bytes will be copied,
and this method will pause if necessary until enough room has been made in the buffer by
readToBytes:count:waitForData: to accommodate the request.
Returns the number of bytes copied.