StreamPeerBuffer¶
Inherits: StreamPeer < Reference < Object
Data buffer stream peer.
Description¶
Data buffer stream peer that uses a byte array as the stream. This object can be used to handle binary data from network sessions. To handle binary data stored in files, File can be used directly.
A StreamPeerBuffer object keeps an internal cursor which is the offset in bytes to the start of the buffer. Get and put operations are performed at the cursor position and will move the cursor accordingly.
Properties¶
|
Methods¶
void |
clear ( ) |
duplicate ( ) const |
|
get_position ( ) const |
|
get_size ( ) const |
|
void |
|
void |
Property Descriptions¶
PoolByteArray data_array = PoolByteArray( )
void set_data_array ( PoolByteArray value )
PoolByteArray get_data_array ( )
The underlying data buffer. Setting this value resets the cursor.
Method Descriptions¶
void clear ( )
Clears the data_array and resets the cursor.
StreamPeerBuffer duplicate ( ) const
Returns a new StreamPeerBuffer with the same data_array content.
int get_position ( ) const
Returns the current cursor position.
int get_size ( ) const
Returns the size of data_array.
void resize ( int size )
Resizes the data_array. This doesn't update the cursor.
void seek ( int position )
Moves the cursor to the specified position. position
must be a valid index of data_array.