If using a BinaryFormatter
to serialize a two dimensional float[,]
array:
var bf = new BinaryFormatter();
using var (fs = new FileStream(filePath, FileMode.Create, FileAccess.Write))
{
bf.Serialize(fs, data);
}
This worked just fine as long as I could use the reverse (float[,])bf.Deserialize(fs);
to deserialize the data. Unfortunatley, I now need to access the previously generated serialized files without the comfort of C#, therefore I'd need to know the information stored in the header of the files.
This header is, at least for my files, 37bytes long and for example contains the following information in this bytes:
- 25-28: Array.Length(0) (aka. "Width")
- 39-32: Array.Length(1) (aka. "Height")
I'd like to know what else is stored in the default header of the serialized data - is there any documentation on this? I alread checked the according page on MSDN and found the source, but that did not clarify anything for me.
Update:
- I found the documentation here: [MS-NRBF]: .NET Remoting: Binary Format Data Structure.
- I also found a similar question on Stackoverflow: .Net Where to find the official specification of the BinaryFormatter serialization format?