Modern implementation of (some) EPD MessageStudio file formats written in managed C#
- MSBT (Message Studio Binary Text)
From Binary
byte[] data = File.ReadAllBytes("path/to/file.msbt");
Msbt msbt = Msbt.FromBinary(data);
From Yaml
string yaml = File.ReadAllText("path/to/file.msbt.yml");
Msbt msbt = Msbt.FromYaml(yaml);
Write Binary (to Stream)
/* ... */
using MemoryStream ms = new();
msbt.WriteBinary(
ms,
endianness: Endian.Little,
encoding: Encoding.Unicode // Encoding.UTF8 is not supported!
);
To Binary (to Bytes)
Note: This method creates a copy of the written bytes.
UseWriteBinary(in Stream, TextEncoding?, Endianness?)
if writing to a stream is possible.
/* ... */
byte[] data = msbt.ToBinary(
endianness: Endian.Little,
encoding: Encoding.Unicode // Encoding.UTF8 is not supported!
);
To Yaml
/* ... */
string yaml = msbt.ToYaml();