fileSystem.readBytes
The file's bytes, or length of them from position. They cross with no
encoding: the ArrayBuffer holds the bytes the platform read.
Usage
Decode a UTF-8 file returned as bytes.
// Decode a UTF-8 file returned as bytes.
import { fileSystem } from 'kuito';
const bytes = await fileSystem.readBytes(fileSystem.documents + 'notes.txt');
const text = new TextDecoder().decode(bytes);
console.log(text);Signatures
(uri: string, range?: ByteRange): Promise<ArrayBuffer>Parameters
| Name | Type | Required | Description |
|---|---|---|---|
uri | string | Yes | — |
range | ByteRange | No | — Default: {} |
Returns
Promise<ArrayBuffer>
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.