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.
Utilização
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);Assinaturas
(uri: string, range?: ByteRange): Promise<ArrayBuffer>Parâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
uri | string | Sim | — |
range | ByteRange | Não | — Predefinição: {} |
Devolve
Promise<ArrayBuffer>
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.