Table of Contents

Class SerializerUtil

Namespace
Vintagestory.API.Util
Assembly
VintagestoryAPI.dll
public static class SerializerUtil
Inheritance
SerializerUtil
Inherited Members

Methods

DeserializeInto<T>(T, byte[])

Uses ProtoBuf.Net to deserialize bytes into existing object T

public static T DeserializeInto<T>(T instance, byte[] data)

Parameters

instance T
data byte[]

Returns

T

Type Parameters

T

Deserialize<T>(byte[])

Uses ProtoBuf.Net to deserialize bytes into T

public static T Deserialize<T>(byte[] data)

Parameters

data byte[]

Returns

T

Type Parameters

T

Deserialize<T>(byte[], T)

Uses ProtoBuf.Net to deserialize bytes into T. Returns the default value if data is null

public static T Deserialize<T>(byte[] data, T defaultValue)

Parameters

data byte[]
defaultValue T

Returns

T

Type Parameters

T

FromBytes(byte[], ByteReadDelegatae)

public static void FromBytes(byte[] data, SerializerUtil.ByteReadDelegatae toRead)

Parameters

data byte[]
toRead SerializerUtil.ByteReadDelegatae

Serialize<T>(T)

Uses ProtoBuf.NET to serialize T into bytes

public static byte[] Serialize<T>(T data)

Parameters

data T

Returns

byte[]

Type Parameters

T

ToBytes(ByteWriteDelegatae)

public static byte[] ToBytes(SerializerUtil.ByteWriteDelegatae toWrite)

Parameters

toWrite SerializerUtil.ByteWriteDelegatae

Returns

byte[]