From b30c566c190162da565ccd7dc58e175301043944 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 3 Feb 2022 13:45:17 +0800 Subject: Add documentation for StreamPeerBuffer --- doc/classes/StreamPeerBuffer.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/classes/StreamPeerBuffer.xml b/doc/classes/StreamPeerBuffer.xml index 989864760f..e335987ff5 100644 --- a/doc/classes/StreamPeerBuffer.xml +++ b/doc/classes/StreamPeerBuffer.xml @@ -1,8 +1,11 @@ + Data buffer stream peer. + 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, [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. @@ -10,38 +13,45 @@ + Clears the [member data_array] and resets the cursor. + Returns a new [StreamPeerBuffer] with the same [member data_array] content. + Returns the current cursor position. + Returns the size of [member data_array]. + Resizes the [member data_array]. This [i]doesn't[/i] update the cursor. + Moves the cursor to the specified position. [code]position[/code] must be a valid index of [member data_array]. + The underlying data buffer. Setting this value resets the cursor. -- cgit v1.2.3