Skip to content

Latest commit

 

History

History
56 lines (41 loc) · 1.23 KB

Readme.md

File metadata and controls

56 lines (41 loc) · 1.23 KB

Message Studio C#

License Downloads

Modern implementation of (some) EPD MessageStudio file formats written in managed C#

Current Support

  • MSBT (Message Studio Binary Text)

MSBT Usage

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.
Use WriteBinary(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();