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.
Checking the stable version of the documentation...
StreamPeerBuffer
繼承: StreamPeer < RefCounted < Object
用於處理二進位資料流的流對等體。
說明
使用位元組陣列作為流的資料緩衝區流對等體。該物件可用於處理來自網路會話的二進位資料。要處理保存在檔中的二進位資料,可以直接使用 FileAccess。
StreamPeerBuffer 物件會保存一個內部指標,是距離該緩衝區開頭的位元組偏移量。Get 和 put 操作都在該指標處進行,並會將其進行對應的移動。
屬性
|
方法
void |
clear() |
duplicate() const |
|
get_position() const |
|
get_size() const |
|
void |
|
void |
屬性說明
PackedByteArray data_array = PackedByteArray() 🔗
void set_data_array(value: PackedByteArray)
PackedByteArray get_data_array()
內部的資料緩衝。設定該值會重設指針。
Note: The returned array is copied and any changes to it will not update the original property value. See PackedByteArray for more details.
方法說明
void clear() 🔗
清除 data_array 並重設指針。
StreamPeerBuffer duplicate() const 🔗
返回新的 StreamPeerBuffer,具有相同的 data_array 內容。
返回目前的指針位置。
返回 data_array 的大小。
調整 data_array 的大小。不會更新指針。
將指標移動到指定的位置。position 必須是 data_array 的有效索引。