feat(adb): start converting to Uint8Array

This commit is contained in:
Simon Chan 2022-02-23 18:14:59 +08:00
parent a7e259c5ad
commit 014145f775
32 changed files with 268 additions and 332 deletions

View file

@ -53,10 +53,10 @@ const Utf8Encoder = new TextEncoder();
// @ts-expect-error @types/node missing `TextDecoder`
const Utf8Decoder = new TextDecoder();
export function encodeUtf8(input: string): ArrayBuffer {
export function encodeUtf8(input: string): Uint8Array {
return Utf8Encoder.encode(input).buffer;
}
export function decodeUtf8(buffer: ArrayBuffer): string {
export function decodeUtf8(buffer: Uint8Array): string {
return Utf8Decoder.decode(buffer);
}