{ } qjs-modules

arraybuffer-sink

Source: quickjs-arraybuffer-sink.c — module export: ArrayBufferSink

An incremental byte accumulator (Bun-style ArrayBufferSink): write chunks, then collect everything as a single ArrayBuffer.

Constructor

new ArrayBufferSink([options])   // length 1

Methods / properties

MemberArgsKindDescription
write(chunk)1methodAppends chunk (string/ArrayBuffer/typed array); returns bytes written.
flush()0methodReturns the bytes accumulated so far and resets the buffer.
end()0methodFinalizes the sink and returns the complete ArrayBuffer.
size—getterNumber of bytes currently buffered.