{ } 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.

Export list

Generated by utilities/doc-api.js from the arraybuffer_sink dump of utilities/api-surface.sh: 8 members. Edit the text above this block, not the block.

ArrayBufferSink

class, constructible

  • methods: end(), flush(), write(), [Symbol.for('qjs.dynbuf')]()
  • properties: size (get), [Symbol.toStringTag]