File tree Expand file tree Collapse file tree 1 file changed +33
-2
lines changed Expand file tree Collapse file tree 1 file changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,39 @@ Modern implementation of (some) EPD MessageStudio file formats written in manage
8
8
9
9
- MSBT (** M** essage ** S** tudio ** B** inary ** T** ext)
10
10
11
- ## Setup
11
+ ### MSBT Usage
12
12
13
+ > From Binary
14
+ ``` cs
15
+ byte [] data = File .ReadAllBytes (" path/to/file.msbt" );
16
+ Msbt msbt = Msbt .FromBinary (data );
13
17
```
14
- ...
18
+
19
+ > From Binary (Constructor)
20
+ ``` cs
21
+ byte [] data = File .ReadAllBytes (" path/to/file.msbt" );
22
+ Msbt msbt = new (data );
23
+ ```
24
+
25
+ > To Binary
26
+ ``` cs
27
+ /* ... */
28
+
29
+ using MemoryStream ms = new ();
30
+ msbt .ToBinary (ms ,
31
+ endianness : Endian .Little ,
32
+ encoding : Encoding .Unicode // Encoding.UTF8 is not supported!
33
+ );
34
+ ```
35
+
36
+ > To Yaml
37
+ ``` cs
38
+ /* ... */
39
+
40
+ string yaml = msbt .ToYaml ();
41
+
42
+ // For performance, use ReadOnlyMsbt
43
+ byte [] data = File .ReadAllBytes (" path/to/file.msbt" );
44
+ ReadOnlyMsbt readOnlyMsbt = new (data );
45
+ string yaml = readOnlyMsbt .ToYaml ();
15
46
```
You can’t perform that action at this time.
0 commit comments