pandemonium_engine_docs/classes/class_streampeerbuffer.rst

117 lines
5.3 KiB
ReStructuredText
Raw Normal View History

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/StreamPeerBuffer.xml.
.. _class_StreamPeerBuffer:
StreamPeerBuffer
================
**Inherits:** :ref:`StreamPeer<class_StreamPeer>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_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, :ref:`File<class_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
----------
+-------------------------------------------+---------------------------------------------------------------+-----------------------+
| :ref:`PoolByteArray<class_PoolByteArray>` | :ref:`data_array<class_StreamPeerBuffer_property_data_array>` | ``PoolByteArray( )`` |
+-------------------------------------------+---------------------------------------------------------------+-----------------------+
Methods
-------
+-------------------------------------------------+--------------------------------------------------------------------------------------------+
| void | :ref:`clear<class_StreamPeerBuffer_method_clear>` **(** **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------+
| :ref:`StreamPeerBuffer<class_StreamPeerBuffer>` | :ref:`duplicate<class_StreamPeerBuffer_method_duplicate>` **(** **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_position<class_StreamPeerBuffer_method_get_position>` **(** **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------+
| :ref:`int<class_int>` | :ref:`get_size<class_StreamPeerBuffer_method_get_size>` **(** **)** |const| |
+-------------------------------------------------+--------------------------------------------------------------------------------------------+
| void | :ref:`resize<class_StreamPeerBuffer_method_resize>` **(** :ref:`int<class_int>` size **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------+
| void | :ref:`seek<class_StreamPeerBuffer_method_seek>` **(** :ref:`int<class_int>` position **)** |
+-------------------------------------------------+--------------------------------------------------------------------------------------------+
Property Descriptions
---------------------
.. _class_StreamPeerBuffer_property_data_array:
- :ref:`PoolByteArray<class_PoolByteArray>` **data_array**
+-----------+-----------------------+
| *Default* | ``PoolByteArray( )`` |
+-----------+-----------------------+
| *Setter* | set_data_array(value) |
+-----------+-----------------------+
| *Getter* | get_data_array() |
+-----------+-----------------------+
The underlying data buffer. Setting this value resets the cursor.
Method Descriptions
-------------------
.. _class_StreamPeerBuffer_method_clear:
- void **clear** **(** **)**
Clears the :ref:`data_array<class_StreamPeerBuffer_property_data_array>` and resets the cursor.
----
.. _class_StreamPeerBuffer_method_duplicate:
- :ref:`StreamPeerBuffer<class_StreamPeerBuffer>` **duplicate** **(** **)** |const|
Returns a new ``StreamPeerBuffer`` with the same :ref:`data_array<class_StreamPeerBuffer_property_data_array>` content.
----
.. _class_StreamPeerBuffer_method_get_position:
- :ref:`int<class_int>` **get_position** **(** **)** |const|
Returns the current cursor position.
----
.. _class_StreamPeerBuffer_method_get_size:
- :ref:`int<class_int>` **get_size** **(** **)** |const|
Returns the size of :ref:`data_array<class_StreamPeerBuffer_property_data_array>`.
----
.. _class_StreamPeerBuffer_method_resize:
- void **resize** **(** :ref:`int<class_int>` size **)**
Resizes the :ref:`data_array<class_StreamPeerBuffer_property_data_array>`. This *doesn't* update the cursor.
----
.. _class_StreamPeerBuffer_method_seek:
- void **seek** **(** :ref:`int<class_int>` position **)**
Moves the cursor to the specified position. ``position`` must be a valid index of :ref:`data_array<class_StreamPeerBuffer_property_data_array>`.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`