mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
165 lines
7.2 KiB
ReStructuredText
165 lines
7.2 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. _class_StreamPeerBuffer:
|
|
|
|
StreamPeerBuffer
|
|
================
|
|
|
|
**Hereda:** :ref:`StreamPeer<class_StreamPeer>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
|
|
|
|
Un par de flujo utilizado para manejar flujos de datos binarios.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
Descripción
|
|
----------------------
|
|
|
|
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, :ref:`FileAccess<class_FileAccess>` 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.
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Propiedades
|
|
----------------------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-----------------------------------------------+---------------------------------------------------------------+-----------------------+
|
|
| :ref:`PackedByteArray<class_PackedByteArray>` | :ref:`data_array<class_StreamPeerBuffer_property_data_array>` | ``PackedByteArray()`` |
|
|
+-----------------------------------------------+---------------------------------------------------------------+-----------------------+
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
Métodos
|
|
--------------
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-------------------------------------------------+-----------------------------------------------------------------------------------------+
|
|
| |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>`\ (\ size\: :ref:`int<class_int>`\ ) |
|
|
+-------------------------------------------------+-----------------------------------------------------------------------------------------+
|
|
| |void| | :ref:`seek<class_StreamPeerBuffer_method_seek>`\ (\ position\: :ref:`int<class_int>`\ ) |
|
|
+-------------------------------------------------+-----------------------------------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Descripciones de Propiedades
|
|
--------------------------------------------------------
|
|
|
|
.. _class_StreamPeerBuffer_property_data_array:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`PackedByteArray<class_PackedByteArray>` **data_array** = ``PackedByteArray()`` :ref:`🔗<class_StreamPeerBuffer_property_data_array>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_data_array**\ (\ value\: :ref:`PackedByteArray<class_PackedByteArray>`\ )
|
|
- :ref:`PackedByteArray<class_PackedByteArray>` **get_data_array**\ (\ )
|
|
|
|
El búfer de datos subyacente. Establecer este valor reinicia el cursor.
|
|
|
|
**Note:** The returned array is *copied* and any changes to it will not update the original property value. See :ref:`PackedByteArray<class_PackedByteArray>` for more details.
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
Descripciones de Métodos
|
|
------------------------------------------------
|
|
|
|
.. _class_StreamPeerBuffer_method_clear:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **clear**\ (\ ) :ref:`🔗<class_StreamPeerBuffer_method_clear>`
|
|
|
|
Limpia el :ref:`data_array<class_StreamPeerBuffer_property_data_array>` y reinicia el cursor.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_StreamPeerBuffer_method_duplicate:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`StreamPeerBuffer<class_StreamPeerBuffer>` **duplicate**\ (\ ) |const| :ref:`🔗<class_StreamPeerBuffer_method_duplicate>`
|
|
|
|
Devuelve un nuevo **StreamPeerBuffer** con el mismo contenido de :ref:`data_array<class_StreamPeerBuffer_property_data_array>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_StreamPeerBuffer_method_get_position:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`int<class_int>` **get_position**\ (\ ) |const| :ref:`🔗<class_StreamPeerBuffer_method_get_position>`
|
|
|
|
Devuelve la posición actual del cursor.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_StreamPeerBuffer_method_get_size:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`int<class_int>` **get_size**\ (\ ) |const| :ref:`🔗<class_StreamPeerBuffer_method_get_size>`
|
|
|
|
Devuelve el tamaño de :ref:`data_array<class_StreamPeerBuffer_property_data_array>`.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_StreamPeerBuffer_method_resize:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **resize**\ (\ size\: :ref:`int<class_int>`\ ) :ref:`🔗<class_StreamPeerBuffer_method_resize>`
|
|
|
|
Redimensiona el :ref:`data_array<class_StreamPeerBuffer_property_data_array>`. Esto *no* actualiza el cursor.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_StreamPeerBuffer_method_seek:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
|void| **seek**\ (\ position\: :ref:`int<class_int>`\ ) :ref:`🔗<class_StreamPeerBuffer_method_seek>`
|
|
|
|
Mueve el cursor a la posición especificada. ``position`` debe ser un índice válido de :ref:`data_array<class_StreamPeerBuffer_property_data_array>`.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (Normalmente, este método debería ser sobreescrito por el usuario para que tenga algún efecto.)`
|
|
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
|
.. |const| replace:: :abbr:`const (Este método no tiene efectos secundarios. No modifica ninguna de las variables miembro de la instancia.)`
|
|
.. |vararg| replace:: :abbr:`vararg (Este método permite agregar cualquier número de argumentos después de los descritos aquí.)`
|
|
.. |constructor| replace:: :abbr:`constructor (Este método se utiliza para construir un tipo.)`
|
|
.. |static| replace:: :abbr:`static (Este método no necesita una instancia para ser llamado, por lo que puede llamarse directamente utilizando el nombre de la clase.)`
|
|
.. |operator| replace:: :abbr:`operator (Este método describe un operador válido para usar con este tipo como operando izquierdo.)`
|
|
.. |bitfield| replace:: :abbr:`BitField (Este valor es un entero compuesto como una máscara de bits de las siguientes banderas.)`
|
|
.. |void| replace:: :abbr:`void (Sin valor de retorno.)`
|