Method WriteValuePacked
WriteValuePacked<TEnum>(FastBufferWriter, TEnum)
Write a packed enum value.
Declaration
public static void WriteValuePacked<TEnum>(FastBufferWriter writer, TEnum value) where TEnum : unmanaged, Enum
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
TEnum | value | The value to write |
Type Parameters
Name | Description |
---|---|
TEnum | An enum type |
WriteValuePacked(FastBufferWriter, float)
Write single-precision floating point value to the buffer as a varint
Declaration
public static void WriteValuePacked(FastBufferWriter writer, float value)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
float | value | Value to write |
WriteValuePacked(FastBufferWriter, double)
Write double-precision floating point value to the buffer as a varint
Declaration
public static void WriteValuePacked(FastBufferWriter writer, double value)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
double | value | Value to write |
WriteValuePacked(FastBufferWriter, byte)
Write a byte to the buffer.
Declaration
public static void WriteValuePacked(FastBufferWriter writer, byte value)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
byte | value | Value to write |
WriteValuePacked(FastBufferWriter, sbyte)
Write a signed byte to the buffer.
Declaration
public static void WriteValuePacked(FastBufferWriter writer, sbyte value)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
sbyte | value | Value to write |
WriteValuePacked(FastBufferWriter, bool)
Write a bool to the buffer.
Declaration
public static void WriteValuePacked(FastBufferWriter writer, bool value)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
bool | value | Value to write |
WriteValuePacked(FastBufferWriter, short)
Write a signed short (Int16) as a ZigZag encoded varint to the buffer. WARNING: If the value you're writing is > 2287, this will use MORE space (3 bytes instead of 2), and if your value is > 240 you'll get no savings at all. Only use this if you're certain your value will be small.
Declaration
public static void WriteValuePacked(FastBufferWriter writer, short value)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
short | value | Value to write |
WriteValuePacked(FastBufferWriter, ushort)
Write an unsigned short (UInt16) as a varint to the buffer. WARNING: If the value you're writing is > 2287, this will use MORE space (3 bytes instead of 2), and if your value is > 240 you'll get no savings at all. Only use this if you're certain your value will be small.
Declaration
public static void WriteValuePacked(FastBufferWriter writer, ushort value)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
ushort | value | Value to write |
WriteValuePacked(FastBufferWriter, char)
Write a two-byte character as a varint to the buffer. WARNING: If the value you're writing is > 2287, this will use MORE space (3 bytes instead of 2), and if your value is > 240 you'll get no savings at all. Only use this if you're certain your value will be small.
Declaration
public static void WriteValuePacked(FastBufferWriter writer, char c)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
char | c | Value to write |
WriteValuePacked(FastBufferWriter, int)
Write a signed int (Int32) as a ZigZag encoded varint to the buffer.
Declaration
public static void WriteValuePacked(FastBufferWriter writer, int value)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
int | value | Value to write |
WriteValuePacked(FastBufferWriter, uint)
Write an unsigned int (UInt32) to the buffer.
Declaration
public static void WriteValuePacked(FastBufferWriter writer, uint value)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
uint | value | Value to write |
WriteValuePacked(FastBufferWriter, ulong)
Write an unsigned long (UInt64) to the buffer.
Declaration
public static void WriteValuePacked(FastBufferWriter writer, ulong value)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
ulong | value | Value to write |
WriteValuePacked(FastBufferWriter, long)
Write a signed long (Int64) as a ZigZag encoded varint to the buffer.
Declaration
public static void WriteValuePacked(FastBufferWriter writer, long value)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
long | value | Value to write |
WriteValuePacked(FastBufferWriter, Ray)
Convenience method that writes two packed Vector3 from the ray to the buffer
Declaration
public static void WriteValuePacked(FastBufferWriter writer, Ray ray)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
Ray | ray | Ray to write |
WriteValuePacked(FastBufferWriter, Ray2D)
Convenience method that writes two packed Vector2 from the ray to the buffer
Declaration
public static void WriteValuePacked(FastBufferWriter writer, Ray2D ray2d)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
Ray2D | ray2d | Ray2D to write |
WriteValuePacked(FastBufferWriter, Color)
Convenience method that writes four varint floats from the color to the buffer
Declaration
public static void WriteValuePacked(FastBufferWriter writer, Color color)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
Color | color | Color to write |
WriteValuePacked(FastBufferWriter, Color32)
Convenience method that writes four varint floats from the color to the buffer
Declaration
public static void WriteValuePacked(FastBufferWriter writer, Color32 color)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
Color32 | color | Color to write |
WriteValuePacked(FastBufferWriter, Vector2)
Convenience method that writes two varint floats from the vector to the buffer
Declaration
public static void WriteValuePacked(FastBufferWriter writer, Vector2 vector2)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
Vector2 | vector2 | Vector to write |
WriteValuePacked(FastBufferWriter, Vector3)
Convenience method that writes three varint floats from the vector to the buffer
Declaration
public static void WriteValuePacked(FastBufferWriter writer, Vector3 vector3)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
Vector3 | vector3 | Vector to write |
WriteValuePacked(FastBufferWriter, Vector4)
Convenience method that writes four varint floats from the vector to the buffer
Declaration
public static void WriteValuePacked(FastBufferWriter writer, Vector4 vector4)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
Vector4 | vector4 | Vector to write |
WriteValuePacked(FastBufferWriter, Quaternion)
Writes the rotation to the buffer.
Declaration
public static void WriteValuePacked(FastBufferWriter writer, Quaternion rotation)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
Quaternion | rotation | Rotation to write |
WriteValuePacked(FastBufferWriter, string)
Writes a string in a packed format
Declaration
public static void WriteValuePacked(FastBufferWriter writer, string s)
Parameters
Type | Name | Description |
---|---|---|
FastBufferWriter | writer | The writer to write to |
string | s | The value to pack |