Class NetworkWriter
A BinaryWriter that can do bit wise manipulation when backed by a NetworkBuffer
Inherited Members
Namespace: MLAPI.Serialization
Assembly: Unity.Multiplayer.MLAPI.Runtime.dll
Syntax
public class NetworkWriter
Constructors
NetworkWriter(Stream)
Creates a new NetworkWriter backed by a given stream
Declaration
public NetworkWriter(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream to use for writing |
Methods
ReadAndWrite(NetworkReader, long)
ReadAndWrite Uses a NetworkReader to read (targetSize) bytes and will write (targetSize) bytes to current stream. This reduces the iterations required to write (n) bytes by a factor of up to 8x less iterations. for blocks of memory that exceed 8 bytes in size. It also doesn't require passing arrays over the stack. Ex: 256 bytes iterates 32 times vs 256 times ------------------------- 8x less iterations 64 bytes iterates 8 times vs 64 times----------------------------- 8x less iterations 22 bytes iterates 5 times ( 2-Int64 1-Int32 2-Byte) vs 22 times -- 4x less iterations
Declaration
public void ReadAndWrite(NetworkReader sourceReader, long targetSize)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkReader | sourceReader | |
| long | targetSize |
SetStream(Stream)
Changes the underlying stream the writer is writing to
Declaration
public void SetStream(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream to write to |
WriteArrayPacked(Array, long)
Writes an array in a packed format
Declaration
public void WriteArrayPacked(Array a, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| Array | a | The array to write |
| long | count | The amount of elements to write |
WriteArrayPackedDiff(Array, Array, long)
Writes the diff between two arrays in a packed format
Declaration
public void WriteArrayPackedDiff(Array write, Array compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| Array | write | The new array |
| Array | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteBit(bool)
Writes a single bit
Declaration
public void WriteBit(bool bit)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | bit |
WriteBits(byte, int)
Write bits to stream.
Declaration
public void WriteBits(byte value, int bitCount)
Parameters
| Type | Name | Description |
|---|---|---|
| byte | value | Value to get bits from. |
| int | bitCount | Amount of bits to write. |
WriteBits(ulong, int)
Write s certain amount of bits to the stream.
Declaration
public void WriteBits(ulong value, int bitCount)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | value | Value to get bits from. |
| int | bitCount | Amount of bits to write |
WriteBool(bool)
Writes a bool as a single bit
Declaration
public void WriteBool(bool value)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | value |
WriteByte(byte)
Write a byte to the stream.
Declaration
public void WriteByte(byte value)
Parameters
| Type | Name | Description |
|---|---|---|
| byte | value | Value to write |
WriteByteArray(byte[], long)
Writes a byte array
Declaration
public void WriteByteArray(byte[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | b | The array to write |
| long | count | The amount of elements to write |
WriteByteArrayDiff(byte[], byte[], long)
Writes the diff between two byte arrays
Declaration
public void WriteByteArrayDiff(byte[] write, byte[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | write | The new array |
| byte[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteBytes(byte[], long, int)
WriteBytes Takes a byte array buffer and writes the bytes into the currently assigned stream at its current position This reduces the iterations required to write (n) bytes by a factor of up to 8x less iterations. for blocks of memory that exceed 8 bytes in size. It also doesn't require passing arrays over the stack. Ex: 256 bytes iterates 32 times vs 256 times ------------------------- 8x less iterations 64 bytes iterates 8 times vs 64 times----------------------------- 8x less iterations 22 bytes iterates 5 times ( 2-Int64 1-Int32 2-Byte) vs 22 times -- 4x less iterations
Declaration
public void WriteBytes(byte[] buffer, long targetSize, int offset = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | buffer | |
| long | targetSize | |
| int | offset |
WriteChar(char)
Write a single character to the stream.
Declaration
public void WriteChar(char c)
Parameters
| Type | Name | Description |
|---|---|---|
| char | c | Character to write |
WriteCharArray(char[], long)
Writes a char array
Declaration
public void WriteCharArray(char[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| char[] | b | The array to write |
| long | count | The amount of elements to write |
WriteCharArrayDiff(char[], char[], long)
Writes the diff between two char arrays
Declaration
public void WriteCharArrayDiff(char[] write, char[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| char[] | write | The new array |
| char[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteCharArrayPacked(char[], long)
Writes a char array in a packed format
Declaration
public void WriteCharArrayPacked(char[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| char[] | b | The array to write |
| long | count | The amount of elements to write |
WriteCharArrayPackedDiff(char[], char[], long)
Writes the diff between two char arrays in a packed format
Declaration
public void WriteCharArrayPackedDiff(char[] write, char[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| char[] | write | The new array |
| char[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteCharPacked(char)
Write a two-byte character as a varint to the stream.
Declaration
public void WriteCharPacked(char c)
Parameters
| Type | Name | Description |
|---|---|---|
| char | c | Value to write |
WriteColor(Color)
Convenience method that writes four non-varint floats from the color to the stream
Declaration
public void WriteColor(Color color)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | color | Color to write |
WriteColor32(Color32)
Convenience method that writes four non-varint floats from the color to the stream
Declaration
public void WriteColor32(Color32 color32)
Parameters
| Type | Name | Description |
|---|---|---|
| Color32 | color32 | Color32 to write |
WriteColorPacked(Color)
Convenience method that writes four varint floats from the color to the stream
Declaration
public void WriteColorPacked(Color color)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | color | Color to write |
WriteDouble(double)
Write double-precision floating point value to the stream
Declaration
public void WriteDouble(double value)
Parameters
| Type | Name | Description |
|---|---|---|
| double | value | Value to write |
WriteDoubleArray(double[], long)
Writes a double array
Declaration
public void WriteDoubleArray(double[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| double[] | b | The array to write |
| long | count | The amount of elements to write |
WriteDoubleArrayDiff(double[], double[], long)
Writes the diff between two double arrays
Declaration
public void WriteDoubleArrayDiff(double[] write, double[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| double[] | write | The new array |
| double[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteDoubleArrayPacked(double[], long)
Writes a double array in a packed format
Declaration
public void WriteDoubleArrayPacked(double[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| double[] | b | The array to write |
| long | count | The amount of elements to write |
WriteDoubleArrayPackedDiff(double[], double[], long)
Writes the diff between two double arrays in a packed format
Declaration
public void WriteDoubleArrayPackedDiff(double[] write, double[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| double[] | write | The new array |
| double[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteDoublePacked(double)
Write double-precision floating point value to the stream as a varint
Declaration
public void WriteDoublePacked(double value)
Parameters
| Type | Name | Description |
|---|---|---|
| double | value | Value to write |
WriteFloatArray(float[], long)
Writes a float array
Declaration
public void WriteFloatArray(float[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| float[] | b | The array to write |
| long | count | The amount of elements to write |
WriteFloatArrayDiff(float[], float[], long)
Writes the diff between two float arrays
Declaration
public void WriteFloatArrayDiff(float[] write, float[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| float[] | write | The new array |
| float[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteFloatArrayPacked(float[], long)
Writes a float array in a packed format
Declaration
public void WriteFloatArrayPacked(float[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| float[] | b | The array to write |
| long | count | The amount of elements to write |
WriteFloatArrayPackedDiff(float[], float[], long)
Writes the diff between two float arrays in a packed format
Declaration
public void WriteFloatArrayPackedDiff(float[] write, float[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| float[] | write | The new array |
| float[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteInt16(short)
Write a signed short (Int16) to the stream.
Declaration
public void WriteInt16(short value)
Parameters
| Type | Name | Description |
|---|---|---|
| short | value | Value to write |
WriteInt16Packed(short)
Write a signed short (Int16) as a ZigZag encoded varint to the stream.
Declaration
public void WriteInt16Packed(short value)
Parameters
| Type | Name | Description |
|---|---|---|
| short | value | Value to write |
WriteInt32(int)
Write a signed int (Int32) to the stream.
Declaration
public void WriteInt32(int value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | value | Value to write |
WriteInt32Packed(int)
Write a signed int (Int32) as a ZigZag encoded varint to the stream.
Declaration
public void WriteInt32Packed(int value)
Parameters
| Type | Name | Description |
|---|---|---|
| int | value | Value to write |
WriteInt64(long)
Write a signed long (Int64) to the stream.
Declaration
public void WriteInt64(long value)
Parameters
| Type | Name | Description |
|---|---|---|
| long | value | Value to write |
WriteInt64Packed(long)
Write a signed long (Int64) as a ZigZag encoded varint to the stream.
Declaration
public void WriteInt64Packed(long value)
Parameters
| Type | Name | Description |
|---|---|---|
| long | value | Value to write |
WriteIntArray(int[], long)
Writes a int array
Declaration
public void WriteIntArray(int[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | b | The array to write |
| long | count | The amount of elements to write |
WriteIntArrayDiff(int[], int[], long)
Writes the diff between two int arrays
Declaration
public void WriteIntArrayDiff(int[] write, int[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | write | The new array |
| int[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteIntArrayPacked(int[], long)
Writes a int array in a packed format
Declaration
public void WriteIntArrayPacked(int[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | b | The array to write |
| long | count | The amount of elements to write |
WriteIntArrayPackedDiff(int[], int[], long)
Writes the diff between two int arrays
Declaration
public void WriteIntArrayPackedDiff(int[] write, int[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| int[] | write | The new array |
| int[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteLongArray(long[], long)
Writes a long array
Declaration
public void WriteLongArray(long[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| long[] | b | The array to write |
| long | count | The amount of elements to write |
WriteLongArrayDiff(long[], long[], long)
Writes the diff between two long arrays
Declaration
public void WriteLongArrayDiff(long[] write, long[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| long[] | write | The new array |
| long[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteLongArrayPacked(long[], long)
Writes a long array in a packed format
Declaration
public void WriteLongArrayPacked(long[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| long[] | b | The array to write |
| long | count | The amount of elements to write |
WriteLongArrayPackedDiff(long[], long[], long)
Writes the diff between two long arrays in a packed format
Declaration
public void WriteLongArrayPackedDiff(long[] write, long[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| long[] | write | The new array |
| long[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteNibble(byte)
Write the lower half (lower nibble) of a byte.
Declaration
public void WriteNibble(byte value)
Parameters
| Type | Name | Description |
|---|---|---|
| byte | value | Value containing nibble to write. |
WriteNibble(byte, bool)
Write either the upper or lower nibble of a byte to the stream.
Declaration
public void WriteNibble(byte value, bool upper)
Parameters
| Type | Name | Description |
|---|---|---|
| byte | value | Value holding the nibble |
| bool | upper | Whether or not the upper nibble should be written. True to write the four high bits, else writes the four low bits. |
WriteObjectPacked(object)
Writes a boxed object in a packed format
Declaration
public void WriteObjectPacked(object value)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | The object to write |
WritePadBits()
Writes pad bits to make the underlying stream aligned
Declaration
public void WritePadBits()
WriteRangedDouble(double, double, double, int)
Write a double-precision floating point value to the stream. The value is between (inclusive) the minValue and maxValue.
Declaration
public void WriteRangedDouble(double value, double minValue, double maxValue, int bytes)
Parameters
| Type | Name | Description |
|---|---|---|
| double | value | Value to write |
| double | minValue | Minimum value that this value could be |
| double | maxValue | Maximum possible value that this could be |
| int | bytes | How many bytes the compressed result should occupy. Must be between 1 and 8 (inclusive) |
WriteRangedSingle(float, float, float, int)
Write a single-precision floating point value to the stream. The value is between (inclusive) the minValue and maxValue.
Declaration
public void WriteRangedSingle(float value, float minValue, float maxValue, int bytes)
Parameters
| Type | Name | Description |
|---|---|---|
| float | value | Value to write |
| float | minValue | Minimum value that this value could be |
| float | maxValue | Maximum possible value that this could be |
| int | bytes | How many bytes the compressed result should occupy. Must be between 1 and 4 (inclusive) |
WriteRay(Ray)
Convenience method that writes two non-packed Vector3 from the ray to the stream
Declaration
public void WriteRay(Ray ray)
Parameters
| Type | Name | Description |
|---|---|---|
| Ray | ray | Ray to write |
WriteRay2D(Ray2D)
Convenience method that writes two non-packed Vector2 from the ray to the stream
Declaration
public void WriteRay2D(Ray2D ray2d)
Parameters
| Type | Name | Description |
|---|---|---|
| Ray2D | ray2d | Ray2D to write |
WriteRay2DPacked(Ray2D)
Convenience method that writes two packed Vector2 from the ray to the stream
Declaration
public void WriteRay2DPacked(Ray2D ray2d)
Parameters
| Type | Name | Description |
|---|---|---|
| Ray2D | ray2d | Ray2D to write |
WriteRayPacked(Ray)
Convenience method that writes two packed Vector3 from the ray to the stream
Declaration
public void WriteRayPacked(Ray ray)
Parameters
| Type | Name | Description |
|---|---|---|
| Ray | ray | Ray to write |
WriteRotation(Quaternion)
Writes the rotation to the stream.
Declaration
public void WriteRotation(Quaternion rotation)
Parameters
| Type | Name | Description |
|---|---|---|
| Quaternion | rotation | Rotation to write |
WriteRotationPacked(Quaternion)
Writes the rotation to the stream.
Declaration
public void WriteRotationPacked(Quaternion rotation)
Parameters
| Type | Name | Description |
|---|---|---|
| Quaternion | rotation | Rotation to write |
WriteSByte(sbyte)
Write a signed byte to the stream.
Declaration
public void WriteSByte(sbyte value)
Parameters
| Type | Name | Description |
|---|---|---|
| sbyte | value | Value to write |
WriteShortArray(short[], long)
Writes a short array
Declaration
public void WriteShortArray(short[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| short[] | b | The array to write |
| long | count | The amount of elements to write |
WriteShortArrayDiff(short[], short[], long)
Writes the diff between two short arrays
Declaration
public void WriteShortArrayDiff(short[] write, short[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| short[] | write | The new array |
| short[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteShortArrayPacked(short[], long)
Writes a short array in a packed format
Declaration
public void WriteShortArrayPacked(short[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| short[] | b | The array to write |
| long | count | The amount of elements to write |
WriteShortArrayPackedDiff(short[], short[], long)
Writes the diff between two short arrays in a packed format
Declaration
public void WriteShortArrayPackedDiff(short[] write, short[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| short[] | write | The new array |
| short[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteSingle(float)
Write single-precision floating point value to the stream
Declaration
public void WriteSingle(float value)
Parameters
| Type | Name | Description |
|---|---|---|
| float | value | Value to write |
WriteSinglePacked(float)
Write single-precision floating point value to the stream as a varint
Declaration
public void WriteSinglePacked(float value)
Parameters
| Type | Name | Description |
|---|---|---|
| float | value | Value to write |
WriteString(string, bool)
Writes a string
Declaration
public void WriteString(string s, bool oneByteChars = false)
Parameters
| Type | Name | Description |
|---|---|---|
| string | s | The string to write |
| bool | oneByteChars | Whether or not to use one byte per character. This will only allow ASCII |
WriteStringDiff(string, string, bool)
Writes the diff between two strings
Declaration
public void WriteStringDiff(string write, string compare, bool oneByteChars = false)
Parameters
| Type | Name | Description |
|---|---|---|
| string | write | The new array |
| string | compare | The previous array to use for diff |
| bool | oneByteChars | Whether or not to use single byte chars. This will only allow ASCII characters |
WriteStringPacked(string)
Writes a string in a packed format
Declaration
public void WriteStringPacked(string s)
Parameters
| Type | Name | Description |
|---|---|---|
| string | s |
WriteStringPackedDiff(string, string)
Writes the diff between two strings in a packed format
Declaration
public void WriteStringPackedDiff(string write, string compare)
Parameters
| Type | Name | Description |
|---|---|---|
| string | write | The new string |
| string | compare | The previous string to use for diff |
WriteUInt16(ushort)
Write an unsigned short (UInt16) to the stream.
Declaration
public void WriteUInt16(ushort value)
Parameters
| Type | Name | Description |
|---|---|---|
| ushort | value | Value to write |
WriteUInt16Packed(ushort)
Write an unsigned short (UInt16) as a varint to the stream.
Declaration
public void WriteUInt16Packed(ushort value)
Parameters
| Type | Name | Description |
|---|---|---|
| ushort | value | Value to write |
WriteUInt32(uint)
Write an unsigned int (UInt32) to the stream.
Declaration
public void WriteUInt32(uint value)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | value | Value to write |
WriteUInt32Packed(uint)
Write an unsigned int (UInt32) as a varint to the stream.
Declaration
public void WriteUInt32Packed(uint value)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | value | Value to write |
WriteUInt64(ulong)
Write an unsigned long (UInt64) to the stream.
Declaration
public void WriteUInt64(ulong value)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | value | Value to write |
WriteUInt64Packed(ulong)
Write an unsigned long (UInt64) as a varint to the stream.
Declaration
public void WriteUInt64Packed(ulong value)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong | value | Value to write |
WriteUIntArray(uint[], long)
Writes a uint array
Declaration
public void WriteUIntArray(uint[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| uint[] | b | The array to write |
| long | count | The amount of elements to write |
WriteUIntArrayDiff(uint[], uint[], long)
Writes the diff between two uint arrays
Declaration
public void WriteUIntArrayDiff(uint[] write, uint[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| uint[] | write | The new array |
| uint[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteUIntArrayPacked(uint[], long)
Writes a uint array in a packed format
Declaration
public void WriteUIntArrayPacked(uint[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| uint[] | b | The array to write |
| long | count | The amount of elements to write |
WriteUIntArrayPackedDiff(uint[], uint[], long)
Writes the diff between two uing arrays in a packed format
Declaration
public void WriteUIntArrayPackedDiff(uint[] write, uint[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| uint[] | write | The new array |
| uint[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteULongArray(ulong[], long)
Writes a ulong array
Declaration
public void WriteULongArray(ulong[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong[] | b | The array to write |
| long | count | The amount of elements to write |
WriteULongArrayDiff(ulong[], ulong[], long)
Writes the diff between two ulong arrays
Declaration
public void WriteULongArrayDiff(ulong[] write, ulong[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong[] | write | The new array |
| ulong[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteULongArrayPacked(ulong[], long)
Writes a ulong array in a packed format
Declaration
public void WriteULongArrayPacked(ulong[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong[] | b | The array to write |
| long | count | The amount of elements to write |
WriteULongArrayPackedDiff(ulong[], ulong[], long)
Writes the diff between two ulong arrays in a packed format
Declaration
public void WriteULongArrayPackedDiff(ulong[] write, ulong[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| ulong[] | write | The new array |
| ulong[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteUShortArray(ushort[], long)
Writes a ushort array
Declaration
public void WriteUShortArray(ushort[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| ushort[] | b | The array to write |
| long | count | The amount of elements to write |
WriteUShortArrayDiff(ushort[], ushort[], long)
Writes the diff between two ushort arrays
Declaration
public void WriteUShortArrayDiff(ushort[] write, ushort[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| ushort[] | write | The new array |
| ushort[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteUShortArrayPacked(ushort[], long)
Writes a ushort array in a packed format
Declaration
public void WriteUShortArrayPacked(ushort[] b, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| ushort[] | b | The array to write |
| long | count | The amount of elements to write |
WriteUShortArrayPackedDiff(ushort[], ushort[], long)
Writes the diff between two ushort arrays in a packed format
Declaration
public void WriteUShortArrayPackedDiff(ushort[] write, ushort[] compare, long count = -1)
Parameters
| Type | Name | Description |
|---|---|---|
| ushort[] | write | The new array |
| ushort[] | compare | The previous array to use for diff |
| long | count | The amount of elements to write |
WriteVector2(Vector2)
Convenience method that writes two non-varint floats from the vector to the stream
Declaration
public void WriteVector2(Vector2 vector2)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | vector2 | Vector to write |
WriteVector2Packed(Vector2)
Convenience method that writes two varint floats from the vector to the stream
Declaration
public void WriteVector2Packed(Vector2 vector2)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | vector2 | Vector to write |
WriteVector3(Vector3)
Convenience method that writes three non-varint floats from the vector to the stream
Declaration
public void WriteVector3(Vector3 vector3)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | vector3 | Vector to write |
WriteVector3Packed(Vector3)
Convenience method that writes three varint floats from the vector to the stream
Declaration
public void WriteVector3Packed(Vector3 vector3)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | vector3 | Vector to write |
WriteVector4(Vector4)
Convenience method that writes four non-varint floats from the vector to the stream
Declaration
public void WriteVector4(Vector4 vector4)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector4 | vector4 | Vector to write |
WriteVector4Packed(Vector4)
Convenience method that writes four varint floats from the vector to the stream
Declaration
public void WriteVector4Packed(Vector4 vector4)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector4 | vector4 | Vector to write |