Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

StreamPeerBuffer

Hérite de : StreamPeer < RefCounted < Object

A stream peer used to handle binary data streams.

Description

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.

Propriétés

PackedByteArray

data_array

PackedByteArray()

Méthodes

void

clear()

StreamPeerBuffer

duplicate() const

int

get_position() const

int

get_size() const

void

resize(size: int)

void

seek(position: int)


Descriptions des propriétés

PackedByteArray data_array = PackedByteArray() 🔗

La mémoire tampon interne. Changer cette valeur réinitialise la position du curseur.

Note: The returned array is copied and any changes to it will not update the original property value. See PackedByteArray for more details.


Descriptions des méthodes

void clear() 🔗

Efface le data_array et rétablit le curseur.


StreamPeerBuffer duplicate() const 🔗

Renvoie un nouveau StreamPeerBuffer avec le même contenu que data_array.


int get_position() const 🔗

Renvoie la position actuelle du curseur.


int get_size() const 🔗

Renvoie la taille de data_array.


void resize(size: int) 🔗

Redimensionne data_array. Cela ne met pas à jour le curseur.


void seek(position: int) 🔗

Déplace le curseur vers la position spécifiée. position doit être un index valide de data_array.