Skip to main content

ta_write_bytes_into

Function ta_write_bytes_into 

Source
pub(crate) fn ta_write_bytes_into(
    this: &Value,
    bytes: &[u8],
    consumed_len: usize,
) -> Value
Expand description

デコードしたバイト列を既存の this(Uint8Array)の先頭から上書きし、 { read, written }read は入力文字列の消費文字数、written は書き込んだ バイト数)を返す共通処理。setFromBase64/setFromHex で共有する。 toBase64/toHex(読み取り)と fromBase64/fromHex(新規生成)は 実装済みだったが、既存バッファへインプレースで書き込む対になる setFromBase64/setFromHex(ES2024/2025)が丸ごと未対応だった。