StreamPeerBuffer

Hereda: StreamPeer < RefCounted < Object

Un par de flujo utilizado para manejar flujos de datos binarios.

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, 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.

Propiedades

PackedByteArray

data_array

PackedByteArray()

Métodos

void

clear()

StreamPeerBuffer

duplicate() const

int

get_position() const

int

get_size() const

void

resize(size: int)

void

seek(position: int)


Descripciones de Propiedades

PackedByteArray data_array = PackedByteArray() 🔗

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 PackedByteArray for more details.


Descripciones de Métodos

void clear() 🔗

Limpia el data_array y reinicia el cursor.


StreamPeerBuffer duplicate() const 🔗

Devuelve un nuevo StreamPeerBuffer con el mismo contenido de data_array.


int get_position() const 🔗

Devuelve la posición actual del cursor.


int get_size() const 🔗

Devuelve el tamaño de data_array.


void resize(size: int) 🔗

Redimensiona el data_array. Esto no actualiza el cursor.


void seek(position: int) 🔗

Mueve el cursor a la posición especificada. position debe ser un índice válido de data_array.