summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2022-02-03 13:45:17 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2022-02-03 16:00:55 +0800
commitb30c566c190162da565ccd7dc58e175301043944 (patch)
tree37500f0b94dd4a30545ead051b4e6083c7cdb145 /doc/classes
parent6de5bafd2fa7513cf78377b61c2606327b293d44 (diff)
Add documentation for StreamPeerBuffer
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/StreamPeerBuffer.xml10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/classes/StreamPeerBuffer.xml b/doc/classes/StreamPeerBuffer.xml
index 989864760f..e335987ff5 100644
--- a/doc/classes/StreamPeerBuffer.xml
+++ b/doc/classes/StreamPeerBuffer.xml
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="StreamPeerBuffer" inherits="StreamPeer" version="4.0">
<brief_description>
+ Data buffer stream peer.
</brief_description>
<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.
</description>
<tutorials>
</tutorials>
@@ -10,38 +13,45 @@
<method name="clear">
<return type="void" />
<description>
+ Clears the [member data_array] and resets the cursor.
</description>
</method>
<method name="duplicate" qualifiers="const">
<return type="StreamPeerBuffer" />
<description>
+ Returns a new [StreamPeerBuffer] with the same [member data_array] content.
</description>
</method>
<method name="get_position" qualifiers="const">
<return type="int" />
<description>
+ Returns the current cursor position.
</description>
</method>
<method name="get_size" qualifiers="const">
<return type="int" />
<description>
+ Returns the size of [member data_array].
</description>
</method>
<method name="resize">
<return type="void" />
<argument index="0" name="size" type="int" />
<description>
+ Resizes the [member data_array]. This [i]doesn't[/i] update the cursor.
</description>
</method>
<method name="seek">
<return type="void" />
<argument index="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].
</description>
</method>
</methods>
<members>
<member name="data_array" type="PackedByteArray" setter="set_data_array" getter="get_data_array" default="PackedByteArray()">
+ The underlying data buffer. Setting this value resets the cursor.
</member>
</members>
</class>