Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


DataStreamExtensions

Extension methods for DataStream.
Read time 1 minuteLast updated 13 days ago

Definition

public static class DataStreamExtensions

Static Methods

Method

Description

CreateInitializes a new instance of the DataStreamWriter struct with externally owned memory
GetUnsafeReadOnlyPtrGet a pointer to the stream's data. Note that the pointer always points at the beginning of the data, no matter how much was read from the stream.
ReadBytesUnsafeRead and copy data to the memory location pointed to, an error will be logged if the
length
will put the reader out of bounds on the current read pointer.
ReadFixedStringUnsafeReads a 2-byte length value from the current stream, reads the specified number of bytes to the buffer and advances the current position of the stream by the length of the string.
ReadPackedFixedStringDeltaUnsafeWrites a delta FixedString value to the data stream using a StreamCompressionModel.
WriteBytesUnsafeAppends a specified number of bytes from the buffer to the data stream.