OptionalstreamEnables streaming mode for partial decoding of incomplete byte sequences.
When true, the decoder preserves incomplete byte sequences at the end of the input for the next decode
operation. This is essential for processing data that arrives in chunks, where a Modified UTF-8 character might
be split across chunk boundaries. When false (default), incomplete sequences at the end are treated as
decoding errors and handled according to the decoder's fatal setting.
const decoder = new MUtf8Decoder();
// First chunk ends with incomplete sequence
const chunk1 = new Uint8Array([0x48, 0x65, 0x6c, 0x6c, 0x6f, 0xe4]);
const result1 = decoder.decode(chunk1, { stream: true });
console.log(result1); // "Hello" (0xe4 is preserved)
// Second chunk completes the sequence
const chunk2 = new Uint8Array([0xb8, 0x96]);
const result2 = decoder.decode(chunk2, { stream: true });
console.log(result2); // "世" (completes the character)
Options for individual decode operations on MUtf8Decoder.
These options are passed to MUtf8Decoder.decode to control how each decoding operation is performed.