This class converts binary data to streams and vice versa and de-/serialzes objects with the BinaryFormatter. More...
Static Public Member Functions | |
static byte[] | ConvertStreamToByteArray (Stream data, int length) |
Converts a stream to a byte array. More... | |
static T | Deserialize< T > (byte[] bytes, int index, int count) |
Converts a byte array to an object of type T with the BinaryFormatter. More... | |
static T | Deserialize< T > (byte[] bytes) |
Converts a byte array to an object of type T with the BinaryFormatter. More... | |
static IFormatter | GetBinaryFormatterThreadStatic () |
Gets a thread static BinaryFormatter. More... | |
static byte[] | ReadBytesFromStream (Stream data, int length) |
Reads the given amount of bytes from a stream. More... | |
static byte[] | Serialize< T > (ref T data) |
Serializes an object of type T. More... | |
This class converts binary data to streams and vice versa and de-/serialzes objects with the BinaryFormatter.
|
inlinestatic |
Converts a stream to a byte array.
data | The data. |
length | The length. |
ArgumentNullException | data is null. |
|
inlinestatic |
Converts a byte array to an object of type T with the BinaryFormatter.
bytes | The bytes. |
T | The object type. |
|
inlinestatic |
Converts a byte array to an object of type T with the BinaryFormatter.
T | The object type. |
bytes | A serialized object of Type T. |
index | The start index. |
count | The length to the serialized object. |
|
inlinestatic |
Gets a thread static BinaryFormatter.
|
inlinestatic |
Reads the given amount of bytes from a stream.
data | The stream. |
length | The length to read. |
ArgumentNullException | data is null. |
|
inlinestatic |
Serializes an object of type T.
T | The object type. |
data | The object to serialize. |