A
Andrew Robinson
I am using the folllowing code to serialize a [serializable] object to a
byte array (byte[]). It works fine, but my resulting array is size is being
rounded up to the next largest 32768 boundary. How can I complete the
serialization without incurring the extra bytes.
I know there is a simple answer....
Thanks,
MemoryStream memoryStream = new MemoryStream();
BinaryFormatter binaryFormatter = new BinaryFormatter();
binaryFormatter.Serialize(memoryStream, myObject);
byte[] b = memoryStream.GetBuffer();
byte array (byte[]). It works fine, but my resulting array is size is being
rounded up to the next largest 32768 boundary. How can I complete the
serialization without incurring the extra bytes.
I know there is a simple answer....
Thanks,
MemoryStream memoryStream = new MemoryStream();
BinaryFormatter binaryFormatter = new BinaryFormatter();
binaryFormatter.Serialize(memoryStream, myObject);
byte[] b = memoryStream.GetBuffer();