2017-09-12 20:42:36 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-06 08:08:05 +00:00
<class name= "StreamPeerBuffer" inherits= "StreamPeer" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-12 20:42:36 +00:00
<brief_description >
2023-04-27 23:35:33 +00:00
A stream peer used to handle binary data streams.
2017-09-12 20:42:36 +00:00
</brief_description>
<description >
2023-04-27 23:35:33 +00:00
A 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, [FileAccess] can be used directly.
2022-02-03 05:45:17 +00:00
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.
2017-09-12 20:42:36 +00:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "clear" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2017-09-12 20:42:36 +00:00
<description >
2022-02-03 05:45:17 +00:00
Clears the [member data_array] and resets the cursor.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "duplicate" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "StreamPeerBuffer" />
2017-09-12 20:42:36 +00:00
<description >
2022-02-03 05:45:17 +00:00
Returns a new [StreamPeerBuffer] with the same [member data_array] content.
2017-09-12 20:42:36 +00:00
</description>
</method>
2017-09-10 13:37:49 +00:00
<method name= "get_position" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2022-02-03 05:45:17 +00:00
Returns the current cursor position.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "get_size" qualifiers= "const" >
2021-07-30 13:28:05 +00:00
<return type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2022-02-03 05:45:17 +00:00
Returns the size of [member data_array].
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "resize" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "size" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2022-02-03 05:45:17 +00:00
Resizes the [member data_array]. This [i]doesn't[/i] update the cursor.
2017-09-12 20:42:36 +00:00
</description>
</method>
<method name= "seek" >
2021-07-30 13:28:05 +00:00
<return type= "void" />
2022-08-06 18:11:48 +00:00
<param index= "0" name= "position" type= "int" />
2017-09-12 20:42:36 +00:00
<description >
2022-08-10 02:00:19 +00:00
Moves the cursor to the specified position. [param position] must be a valid index of [member data_array].
2017-09-12 20:42:36 +00:00
</description>
</method>
</methods>
2018-01-11 22:38:35 +00:00
<members >
2019-09-24 17:45:03 +00:00
<member name= "data_array" type= "PackedByteArray" setter= "set_data_array" getter= "get_data_array" default= "PackedByteArray()" >
2022-02-03 05:45:17 +00:00
The underlying data buffer. Setting this value resets the cursor.
2018-01-11 22:38:35 +00:00
</member>
</members>
2017-09-12 20:42:36 +00:00
</class>