mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-06 03:50:18 +02:00
feat(adb): start converting to Uint8Array
This commit is contained in:
parent
a7e259c5ad
commit
014145f775
32 changed files with 268 additions and 332 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue