Skip to main content

MLAPI.Serialization.NetworkWriter

A BinaryWriter that can do bit wise manipulation when backed by a NetworkBuffer

Inheritance#

System.Dynamic.ExpandoObject

System.Dynamic.ExpandoObject

System.Dynamic.ExpandoObject

Inherited Members#

Object.Equals(Object)

Object.Equals(Object, Object)

Object.GetHashCode()

Object.GetType()

Object.MemberwiseClone()

Object.ReferenceEquals(Object, Object)

Object.ToString()

Namespace: System.Dynamic.ExpandoObject#
Assembly: MLAPI.dll#
Syntax#
public class NetworkWriter

Constructors#

NetworkWriter(Stream)#

Creates a new NetworkWriter backed by a given stream

Declaration#

public NetworkWriter(Stream stream)

Parameters#

TypeNameDescription
System.IO.StreamstreamThe stream to use for writing

Methods#

ReadAndWrite(NetworkReader, Int64)#

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#

TypeNameDescription
NetworkReadersourceReader
System.Int64targetSize

SetStream(Stream)#

Changes the underlying stream the writer is writing to

Declaration#

public void SetStream(Stream stream)

Parameters#

TypeNameDescription
System.IO.StreamstreamThe stream to write to

WriteArrayPacked(Array, Int64)#

Writes an array in a packed format

Declaration#

public void WriteArrayPacked(Array a, long count = -1L)

Parameters#

TypeNameDescription
System.ArrayaThe array to write
System.Int64countThe amount of elements to write

WriteArrayPackedDiff(Array, Array, Int64)#

Writes the diff between two arrays in a packed format

Declaration#

public void WriteArrayPackedDiff(Array write, Array compare, long count = -1L)

Parameters#

TypeNameDescription
System.ArraywriteThe new array
System.ArraycompareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteBit(Boolean)#

Writes a single bit

Declaration#

public void WriteBit(bool bit)

Parameters#

TypeNameDescription
System.Booleanbit

WriteBits(Byte, Int32)#

Write bits to stream.

Declaration#

public void WriteBits(byte value, int bitCount)

Parameters#

TypeNameDescription
System.BytevalueValue to get bits from.
System.Int32bitCountAmount of bits to write.

WriteBits(UInt64, Int32)#

Write a certain amount of bits to the stream.

Declaration#

public void WriteBits(ulong value, int bitCount)

Parameters#

TypeNameDescription
System.UInt64valueValue to get bits from.
System.Int32bitCountAmount of bits to write

WriteBool(Boolean)#

Writes a bool as a single bit

Declaration#

public void WriteBool(bool value)

Parameters#

TypeNameDescription
System.Booleanvalue

WriteByte(Byte)#

Write a byte to the stream.

Declaration#

public void WriteByte(byte value)

Parameters#

TypeNameDescription
System.BytevalueValue to write

WriteByteArray(Byte[], Int64)#

Writes a byte array

Declaration#

public void WriteByteArray(byte[] b, long count = -1L)

Parameters#

TypeNameDescription
System.Byte[]bThe array to write
System.Int64countThe amount of elements to write

WriteByteArrayDiff(Byte[], Byte[], Int64)#

Writes the diff between two byte arrays

Declaration#

public void WriteByteArrayDiff(byte[] write, byte[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.Byte[]writeThe new array
System.Byte[]compareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteBytes(Byte[], Int64, Int32)#

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#

TypeNameDescription
System.Byte[]buffer
System.Int64targetSize
System.Int32offset

WriteChar(Char)#

Write a single character to the stream.

Declaration#

public void WriteChar(char c)

Parameters#

TypeNameDescription
System.CharcCharacter to write

WriteCharArray(Char[], Int64)#

Writes a char array

Declaration#

public void WriteCharArray(char[] b, long count = -1L)

Parameters#

TypeNameDescription
System.Char[]bThe array to write
System.Int64countThe amount of elements to write

WriteCharArrayDiff(Char[], Char[], Int64)#

Writes the diff between two char arrays

Declaration#

public void WriteCharArrayDiff(char[] write, char[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.Char[]writeThe new array
System.Char[]compareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteCharArrayPacked(Char[], Int64)#

Writes a char array in a packed format

Declaration#

public void WriteCharArrayPacked(char[] b, long count = -1L)

Parameters#

TypeNameDescription
System.Char[]bThe array to write
System.Int64countThe amount of elements to write

WriteCharArrayPackedDiff(Char[], Char[], Int64)#

Writes the diff between two char arrays in a packed format

Declaration#

public void WriteCharArrayPackedDiff(char[] write, char[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.Char[]writeThe new array
System.Char[]compareThe previous array to use for diff
System.Int64countThe 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#

TypeNameDescription
System.CharcValue 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#

TypeNameDescription
UnityEngine.ColorcolorColor 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#

TypeNameDescription
UnityEngine.Color32color32Color32 to write

WriteColorPacked(Color)#

Convenience method that writes four varint floats from the color to the stream

Declaration#

public void WriteColorPacked(Color color)

Parameters#

TypeNameDescription
UnityEngine.ColorcolorColor to write

WriteDouble(Double)#

Write double-precision floating point value to the stream

Declaration#

public void WriteDouble(double value)

Parameters#

TypeNameDescription
System.DoublevalueValue to write

WriteDoubleArray(Double[], Int64)#

Writes a double array

Declaration#

public void WriteDoubleArray(double[] b, long count = -1L)

Parameters#

TypeNameDescription
System.Double[]bThe array to write
System.Int64countThe amount of elements to write

WriteDoubleArrayDiff(Double[], Double[], Int64)#

Writes the diff between two double arrays

Declaration#

public void WriteDoubleArrayDiff(double[] write, double[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.Double[]writeThe new array
System.Double[]compareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteDoubleArrayPacked(Double[], Int64)#

Writes a double array in a packed format

Declaration#

public void WriteDoubleArrayPacked(double[] b, long count = -1L)

Parameters#

TypeNameDescription
System.Double[]bThe array to write
System.Int64countThe amount of elements to write

WriteDoubleArrayPackedDiff(Double[], Double[], Int64)#

Writes the diff between two double arrays in a packed format

Declaration#

public void WriteDoubleArrayPackedDiff(double[] write, double[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.Double[]writeThe new array
System.Double[]compareThe previous array to use for diff
System.Int64countThe 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#

TypeNameDescription
System.DoublevalueValue to write

WriteFloatArray(Single[], Int64)#

Writes a float array

Declaration#

public void WriteFloatArray(float[] b, long count = -1L)

Parameters#

TypeNameDescription
System.Single[]bThe array to write
System.Int64countThe amount of elements to write

WriteFloatArrayDiff(Single[], Single[], Int64)#

Writes the diff between two float arrays

Declaration#

public void WriteFloatArrayDiff(float[] write, float[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.Single[]writeThe new array
System.Single[]compareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteFloatArrayPacked(Single[], Int64)#

Writes a float array in a packed format

Declaration#

public void WriteFloatArrayPacked(float[] b, long count = -1L)

Parameters#

TypeNameDescription
System.Single[]bThe array to write
System.Int64countThe amount of elements to write

WriteFloatArrayPackedDiff(Single[], Single[], Int64)#

Writes the diff between two float arrays in a packed format

Declaration#

public void WriteFloatArrayPackedDiff(float[] write, float[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.Single[]writeThe new array
System.Single[]compareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteInt16(Int16)#

Write a signed short (Int16) to the stream.

Declaration#

public void WriteInt16(short value)

Parameters#

TypeNameDescription
System.Int16valueValue to write

WriteInt16Packed(Int16)#

Write a signed short (Int16) as a ZigZag encoded varint to the stream.

Declaration#

public void WriteInt16Packed(short value)

Parameters#

TypeNameDescription
System.Int16valueValue to write

WriteInt32(Int32)#

Write a signed int (Int32) to the stream.

Declaration#

public void WriteInt32(int value)

Parameters#

TypeNameDescription
System.Int32valueValue to write

WriteInt32Packed(Int32)#

Write a signed int (Int32) as a ZigZag encoded varint to the stream.

Declaration#

public void WriteInt32Packed(int value)

Parameters#

TypeNameDescription
System.Int32valueValue to write

WriteInt64(Int64)#

Write a signed long (Int64) to the stream.

Declaration#

public void WriteInt64(long value)

Parameters#

TypeNameDescription
System.Int64valueValue to write

WriteInt64Packed(Int64)#

Write a signed long (Int64) as a ZigZag encoded varint to the stream.

Declaration#

public void WriteInt64Packed(long value)

Parameters#

TypeNameDescription
System.Int64valueValue to write

WriteIntArray(Int32[], Int64)#

Writes a int array

Declaration#

public void WriteIntArray(int[] b, long count = -1L)

Parameters#

TypeNameDescription
System.Int32[]bThe array to write
System.Int64countThe amount of elements to write

WriteIntArrayDiff(Int32[], Int32[], Int64)#

Writes the diff between two int arrays

Declaration#

public void WriteIntArrayDiff(int[] write, int[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.Int32[]writeThe new array
System.Int32[]compareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteIntArrayPacked(Int32[], Int64)#

Writes a int array in a packed format

Declaration#

public void WriteIntArrayPacked(int[] b, long count = -1L)

Parameters#

TypeNameDescription
System.Int32[]bThe array to write
System.Int64countThe amount of elements to write

WriteIntArrayPackedDiff(Int32[], Int32[], Int64)#

Writes the diff between two int arrays

Declaration#

public void WriteIntArrayPackedDiff(int[] write, int[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.Int32[]writeThe new array
System.Int32[]compareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteLongArray(Int64[], Int64)#

Writes a long array

Declaration#

public void WriteLongArray(long[] b, long count = -1L)

Parameters#

TypeNameDescription
System.Int64[]bThe array to write
System.Int64countThe amount of elements to write

WriteLongArrayDiff(Int64[], Int64[], Int64)#

Writes the diff between two long arrays

Declaration#

public void WriteLongArrayDiff(long[] write, long[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.Int64[]writeThe new array
System.Int64[]compareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteLongArrayPacked(Int64[], Int64)#

Writes a long array in a packed format

Declaration#

public void WriteLongArrayPacked(long[] b, long count = -1L)

Parameters#

TypeNameDescription
System.Int64[]bThe array to write
System.Int64countThe amount of elements to write

WriteLongArrayPackedDiff(Int64[], Int64[], Int64)#

Writes the diff between two long arrays in a packed format

Declaration#

public void WriteLongArrayPackedDiff(long[] write, long[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.Int64[]writeThe new array
System.Int64[]compareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteNibble(Byte)#

Write the lower half (lower nibble) of a byte.

Declaration#

public void WriteNibble(byte value)

Parameters#

TypeNameDescription
System.BytevalueValue containing nibble to write.

WriteNibble(Byte, Boolean)#

Write either the upper or lower nibble of a byte to the stream.

Declaration#

public void WriteNibble(byte value, bool upper)

Parameters#

TypeNameDescription
System.BytevalueValue holding the nibble
System.BooleanupperWhether 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#

TypeNameDescription
System.ObjectvalueThe object to write

WritePadBits()#

Writes pad bits to make the underlying stream aligned

Declaration#

public void WritePadBits()

WriteRangedDouble(Double, Double, Double, Int32)#

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#

TypeNameDescription
System.DoublevalueValue to write
System.DoubleminValueMinimum value that this value could be
System.DoublemaxValueMaximum possible value that this could be
System.Int32bytesHow many bytes the compressed result should occupy. Must be between 1 and 8 (inclusive)

WriteRangedSingle(Single, Single, Single, Int32)#

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#

TypeNameDescription
System.SinglevalueValue to write
System.SingleminValueMinimum value that this value could be
System.SinglemaxValueMaximum possible value that this could be
System.Int32bytesHow 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#

TypeNameDescription
UnityEngine.RayrayRay 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#

TypeNameDescription
UnityEngine.Ray2Dray2dRay2D to write

WriteRay2DPacked(Ray2D)#

Convenience method that writes two packed Vector2 from the ray to the stream

Declaration#

public void WriteRay2DPacked(Ray2D ray2d)

Parameters#

TypeNameDescription
UnityEngine.Ray2Dray2dRay2D to write

WriteRayPacked(Ray)#

Convenience method that writes two packed Vector3 from the ray to the stream

Declaration#

public void WriteRayPacked(Ray ray)

Parameters#

TypeNameDescription
UnityEngine.RayrayRay to write

WriteRotation(Quaternion)#

Writes the rotation to the stream.

Declaration#

public void WriteRotation(Quaternion rotation)

Parameters#

TypeNameDescription
UnityEngine.QuaternionrotationRotation to write

WriteRotationPacked(Quaternion)#

Writes the rotation to the stream.

Declaration#

public void WriteRotationPacked(Quaternion rotation)

Parameters#

TypeNameDescription
UnityEngine.QuaternionrotationRotation to write

WriteSByte(SByte)#

Write a signed byte to the stream.

Declaration#

public void WriteSByte(sbyte value)

Parameters#

TypeNameDescription
System.SBytevalueValue to write

WriteShortArray(Int16[], Int64)#

Writes a short array

Declaration#

public void WriteShortArray(short[] b, long count = -1L)

Parameters#

TypeNameDescription
System.Int16[]bThe array to write
System.Int64countThe amount of elements to write

WriteShortArrayDiff(Int16[], Int16[], Int64)#

Writes the diff between two short arrays

Declaration#

public void WriteShortArrayDiff(short[] write, short[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.Int16[]writeThe new array
System.Int16[]compareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteShortArrayPacked(Int16[], Int64)#

Writes a short array in a packed format

Declaration#

public void WriteShortArrayPacked(short[] b, long count = -1L)

Parameters#

TypeNameDescription
System.Int16[]bThe array to write
System.Int64countThe amount of elements to write

WriteShortArrayPackedDiff(Int16[], Int16[], Int64)#

Writes the diff between two short arrays in a packed format

Declaration#

public void WriteShortArrayPackedDiff(short[] write, short[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.Int16[]writeThe new array
System.Int16[]compareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteSingle(Single)#

Write single-precision floating point value to the stream

Declaration#

public void WriteSingle(float value)

Parameters#

TypeNameDescription
System.SinglevalueValue to write

WriteSinglePacked(Single)#

Write single-precision floating point value to the stream as a varint

Declaration#

public void WriteSinglePacked(float value)

Parameters#

TypeNameDescription
System.SinglevalueValue to write

WriteString(String, Boolean)#

Writes a string

Declaration#

public void WriteString(string s, bool oneByteChars = false)

Parameters#

TypeNameDescription
System.StringsThe string to write
System.BooleanoneByteCharsWhether or not to use one byte per character. This will only allow ASCII

WriteStringDiff(String, String, Boolean)#

Writes the diff between two strings

Declaration#

public void WriteStringDiff(string write, string compare, bool oneByteChars = false)

Parameters#

TypeNameDescription
System.StringwriteThe new array
System.StringcompareThe previous array to use for diff
System.BooleanoneByteCharsWhether 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#

TypeNameDescription
System.Strings

WriteStringPackedDiff(String, String)#

Writes the diff between two strings in a packed format

Declaration#

public void WriteStringPackedDiff(string write, string compare)

Parameters#

TypeNameDescription
System.StringwriteThe new string
System.StringcompareThe previous string to use for diff

WriteUInt16(UInt16)#

Write an unsigned short (UInt16) to the stream.

Declaration#

public void WriteUInt16(ushort value)

Parameters#

TypeNameDescription
System.UInt16valueValue to write

WriteUInt16Packed(UInt16)#

Write an unsigned short (UInt16) as a varint to the stream.

Declaration#

public void WriteUInt16Packed(ushort value)

Parameters#

TypeNameDescription
System.UInt16valueValue to write

WriteUInt32(UInt32)#

Write an unsigned int (UInt32) to the stream.

Declaration#

public void WriteUInt32(uint value)

Parameters#

TypeNameDescription
System.UInt32valueValue to write

WriteUInt32Packed(UInt32)#

Write an unsigned int (UInt32) as a varint to the stream.

Declaration#

public void WriteUInt32Packed(uint value)

Parameters#

TypeNameDescription
System.UInt32valueValue to write

WriteUInt64(UInt64)#

Write an unsigned long (UInt64) to the stream.

Declaration#

public void WriteUInt64(ulong value)

Parameters#

TypeNameDescription
System.UInt64valueValue to write

WriteUInt64Packed(UInt64)#

Write an unsigned long (UInt64) as a varint to the stream.

Declaration#

public void WriteUInt64Packed(ulong value)

Parameters#

TypeNameDescription
System.UInt64valueValue to write

WriteUIntArray(UInt32[], Int64)#

Writes a uint array

Declaration#

public void WriteUIntArray(uint[] b, long count = -1L)

Parameters#

TypeNameDescription
System.UInt32[]bThe array to write
System.Int64countThe amount of elements to write

WriteUIntArrayDiff(UInt32[], UInt32[], Int64)#

Writes the diff between two uint arrays

Declaration#

public void WriteUIntArrayDiff(uint[] write, uint[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.UInt32[]writeThe new array
System.UInt32[]compareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteUIntArrayPacked(UInt32[], Int64)#

Writes a uint array in a packed format

Declaration#

public void WriteUIntArrayPacked(uint[] b, long count = -1L)

Parameters#

TypeNameDescription
System.UInt32[]bThe array to write
System.Int64countThe amount of elements to write

WriteUIntArrayPackedDiff(UInt32[], UInt32[], Int64)#

Writes the diff between two uing arrays in a packed format

Declaration#

public void WriteUIntArrayPackedDiff(uint[] write, uint[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.UInt32[]writeThe new array
System.UInt32[]compareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteULongArray(UInt64[], Int64)#

Writes a ulong array

Declaration#

public void WriteULongArray(ulong[] b, long count = -1L)

Parameters#

TypeNameDescription
System.UInt64[]bThe array to write
System.Int64countThe amount of elements to write

WriteULongArrayDiff(UInt64[], UInt64[], Int64)#

Writes the diff between two ulong arrays

Declaration#

public void WriteULongArrayDiff(ulong[] write, ulong[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.UInt64[]writeThe new array
System.UInt64[]compareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteULongArrayPacked(UInt64[], Int64)#

Writes a ulong array in a packed format

Declaration#

public void WriteULongArrayPacked(ulong[] b, long count = -1L)

Parameters#

TypeNameDescription
System.UInt64[]bThe array to write
System.Int64countThe amount of elements to write

WriteULongArrayPackedDiff(UInt64[], UInt64[], Int64)#

Writes the diff between two ulong arrays in a packed format

Declaration#

public void WriteULongArrayPackedDiff(ulong[] write, ulong[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.UInt64[]writeThe new array
System.UInt64[]compareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteUShortArray(UInt16[], Int64)#

Writes a ushort array

Declaration#

public void WriteUShortArray(ushort[] b, long count = -1L)

Parameters#

TypeNameDescription
System.UInt16[]bThe array to write
System.Int64countThe amount of elements to write

WriteUShortArrayDiff(UInt16[], UInt16[], Int64)#

Writes the diff between two ushort arrays

Declaration#

public void WriteUShortArrayDiff(ushort[] write, ushort[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.UInt16[]writeThe new array
System.UInt16[]compareThe previous array to use for diff
System.Int64countThe amount of elements to write

WriteUShortArrayPacked(UInt16[], Int64)#

Writes a ushort array in a packed format

Declaration#

public void WriteUShortArrayPacked(ushort[] b, long count = -1L)

Parameters#

TypeNameDescription
System.UInt16[]bThe array to write
System.Int64countThe amount of elements to write

WriteUShortArrayPackedDiff(UInt16[], UInt16[], Int64)#

Writes the diff between two ushort arrays in a packed format

Declaration#

public void WriteUShortArrayPackedDiff(ushort[] write, ushort[] compare, long count = -1L)

Parameters#

TypeNameDescription
System.UInt16[]writeThe new array
System.UInt16[]compareThe previous array to use for diff
System.Int64countThe 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#

TypeNameDescription
UnityEngine.Vector2vector2Vector to write

WriteVector2Packed(Vector2)#

Convenience method that writes two varint floats from the vector to the stream

Declaration#

public void WriteVector2Packed(Vector2 vector2)

Parameters#

TypeNameDescription
UnityEngine.Vector2vector2Vector 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#

TypeNameDescription
UnityEngine.Vector3vector3Vector to write

WriteVector3Packed(Vector3)#

Convenience method that writes three varint floats from the vector to the stream

Declaration#

public void WriteVector3Packed(Vector3 vector3)

Parameters#

TypeNameDescription
UnityEngine.Vector3vector3Vector 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#

TypeNameDescription
UnityEngine.Vector4vector4Vector to write

WriteVector4Packed(Vector4)#

Convenience method that writes four varint floats from the vector to the stream

Declaration#

public void WriteVector4Packed(Vector4 vector4)

Parameters#

TypeNameDescription
UnityEngine.Vector4vector4Vector to write