Skip to content

Commit ce2e70f

Browse files
committed
docs: update README
1 parent c2a4a02 commit ce2e70f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,25 @@ After running the two code snippets above, file should contain:
331331
>
332332
> Beware of flatlines...
333333
334+
### Read raw data
335+
```swift
336+
// File
337+
public func ReadAsBase64() -> String;
338+
339+
// AsyncFile
340+
public func ReadAsBase64(promise: FilePromise) -> Void;
341+
```
342+
343+
You can read binary data (e.g. PNG file) as an encoded Base64 string.
344+
```swift
345+
let file = FileSystem.GetSharedStorage().GetFile("screenshot.png");
346+
let data = file.ReadAsBase64();
347+
```
348+
349+
> [!NOTE]
350+
> This feature was introduced in `v0.13.0`. This version was not released on
351+
> NexusMod on purpose. It might be published later with a future update.
352+
334353
### Read Json
335354
```swift
336355
// File

0 commit comments

Comments
 (0)