Class ReadExtensions
Static class that contains various extension methods
that allow reading data types from a buffer.
Inheritance
ReadExtensions
Syntax
public static class ReadExtensions
Methods
Read16(Buffer)
Reads a short (16-bit value) from the buffer.
Declaration
public static short Read16(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Int16 |
The short that has been read from the buffer.
|
Read32(Buffer)
Reads an integer (32-bit value) from the buffer.
Declaration
public static int Read32(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Int32 |
The integer that has been read from the buffer.
|
ReadBoolean(Buffer)
Reads a boolean from the buffer.
Declaration
public static bool ReadBoolean(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Boolean |
The boolean value that has been read from the buffer.
|
ReadByte(Buffer)
Reads a single byte (8-bit value) from the buffer.
Declaration
public static byte ReadByte(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Byte |
The byte that has been read from the buffer.
|
ReadBytes(Buffer, Byte[], Int32, Int32)
Reads a series of bytes from the buffer.
Declaration
public static void ReadBytes(this Buffer buffer, byte[] rhs, int offset, int amount)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
| Byte[] |
rhs |
Destination array that the bytes should be written to.
|
| Int32 |
offset |
Offset into the destination array where the bytes should be written to.
|
| Int32 |
amount |
Number of bytes to be read from the buffer.
|
ReadBytes(Buffer, Int32)
Reads a series of bytes from the buffer.
Declaration
public static byte[] ReadBytes(this Buffer buffer, int amount)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
| Int32 |
amount |
Number of bytes to be read from the buffer.
|
Returns
| Type |
Description |
| Byte[] |
The array of bytes that has been read from the buffer.
|
ReadColor(Buffer)
Reads a color from the buffer.
Declaration
public static Color ReadColor(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Color |
The color that has been read from the buffer.
|
ReadColor32(Buffer)
Reads a color from the buffer.
Declaration
public static Color32 ReadColor32(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Color32 |
The color that has been read from the buffer.
|
ReadComponent<T>(Buffer)
Reads a component reference from the buffer.
Declaration
public static T ReadComponent<T>(this Buffer buffer)
where T : Component
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| T |
The component reference that has been read from the buffer.
|
Type Parameters
ReadFromStream<T>(NativeArray<T>, Buffer)
Reads a native array from the buffer.
Declaration
public static void ReadFromStream<T>(this NativeArray<T> nativeArray, Buffer buffer)
where T : struct
Parameters
Type Parameters
ReadFromStream<T>(NativeList<T>, Buffer)
Reads a native list from the buffer.
Declaration
public static void ReadFromStream<T>(this NativeList<T> nativeList, Buffer buffer)
where T : struct
Parameters
Type Parameters
ReadFromStream<T>(NativeSlice<T>, Buffer)
Declaration
public static void ReadFromStream<T>(this NativeSlice<T> nativeSlice, Buffer buffer)
where T : struct
Parameters
Type Parameters
ReadNativeArray<T>(Buffer, out Allocator)
Declaration
public static NativeArray<T> ReadNativeArray<T>(this Buffer buffer, out Allocator allocator)
where T : struct
Parameters
Returns
Type Parameters
ReadNativeList<T>(Buffer, out Allocator)
Declaration
public static NativeList<T> ReadNativeList<T>(this Buffer buffer, out Allocator allocator)
where T : struct
Parameters
Returns
Type Parameters
ReadNativeString64(Buffer)
Declaration
public static NativeString64 ReadNativeString64(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
ReadQuaternion(Buffer)
Reads a quaternion from the buffer.
Declaration
public static Quaternion ReadQuaternion(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Quaternion |
The quaternion that has been read from the buffer.
|
ReadQuaternionQuantized(Buffer)
Reads a quantized quaternion from the buffer.
Declaration
public static Quaternion ReadQuaternionQuantized(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Quaternion |
The original quaternion value.
|
ReadSingle(Buffer)
Reads a 32-bit floating point value from the buffer.
Declaration
public static float ReadSingle(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Single |
The floating point value that has been read from the buffer.
|
ReadSingleQuantized(Buffer)
Reads a quantized floating point value from the buffer.
Declaration
public static float ReadSingleQuantized(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Single |
The original floating point value.
|
ReadString(Buffer)
Reads a string from the buffer.
Declaration
public static string ReadString(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| String |
The string that has been read from the buffer.
|
Reads a transform reference from the buffer.
Declaration
public static Transform ReadTransform(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Transform |
A reference to the transform that has been read from the buffer.
|
ReadVector2(Buffer)
Reads a vector2 from the buffer.
Declaration
public static Vector2 ReadVector2(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Vector2 |
The vector that has been read from the buffer.
|
ReadVector2Quantized(Buffer)
Reads a quantized vector2 from the buffer.
Declaration
public static Vector2 ReadVector2Quantized(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Vector2 |
The original vector2 value.
|
ReadVector3(Buffer)
Reads a vector3 from the buffer.
Declaration
public static Vector3 ReadVector3(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Vector3 |
The vector that has been read from the buffer.
|
ReadVector3Quantized(Buffer)
Reads a quantized vector3 from the buffer.
Declaration
public static Vector3 ReadVector3Quantized(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Vector3 |
The original vector3 value.
|
ReadVector4(Buffer)
Reads a vector4 from the buffer.
Declaration
public static Vector4 ReadVector4(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Vector4 |
The vector that has been read from the buffer.
|
ReadVector4Quantized(Buffer)
Reads a quantized vector4 from the buffer.
Declaration
public static Vector4 ReadVector4Quantized(this Buffer buffer)
Parameters
| Type |
Name |
Description |
| Buffer |
buffer |
|
Returns
| Type |
Description |
| Vector4 |
The original vector4 value.
|
See Also