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.
</description>
<tutorials>
</tutorials>
<methods>
<methodname="clear">
<returntype="void"/>
<description>
Clears the [member data_array] and resets the cursor.
</description>
</method>
<methodname="duplicate"qualifiers="const">
<returntype="StreamPeerBuffer"/>
<description>
Returns a new [StreamPeerBuffer] with the same [member data_array] content.
</description>
</method>
<methodname="get_position"qualifiers="const">
<returntype="int"/>
<description>
Returns the current cursor position.
</description>
</method>
<methodname="get_size"qualifiers="const">
<returntype="int"/>
<description>
Returns the size of [member data_array].
</description>
</method>
<methodname="resize">
<returntype="void"/>
<argumentindex="0"name="size"type="int"/>
<description>
Resizes the [member data_array]. This [i]doesn't[/i] update the cursor.
</description>
</method>
<methodname="seek">
<returntype="void"/>
<argumentindex="0"name="position"type="int"/>
<description>
Moves the cursor to the specified position. [code]position[/code] must be a valid index of [member data_array].