sempdf

Class: BufferSink

sempdf v1.9.1


sempdf / BufferSink

Defined in: src/internal/byte-sink.ts:40

Streaming output contract implemented by sinks that receive generated PDF byte chunks.

Implements

Constructors

Constructor

new BufferSink(options?): BufferSink;

Defined in: src/internal/byte-sink.ts:57

Creates a memory-backed byte sink with an optional capacity limit.

Parameters

ParameterTypeDescription
optionsBufferSinkOptionsOptions that control the sink behavior.

Returns

BufferSink

Methods

close()

close(): Promise<void>;

Defined in: src/internal/byte-sink.ts:83

Marks the sink as closed so no more chunks can be written.

Returns

Promise<void>

Implementation of

ByteSink.close


collect()

collect(): Uint8Array;

Defined in: src/internal/byte-sink.ts:92

Combines all collected chunks into a single Uint8Array.

Returns

Uint8Array

The collected bytes.


write()

write(chunk): Promise<void>;

Defined in: src/internal/byte-sink.ts:66

Stores a streamed byte chunk in memory.

Parameters

ParameterTypeDescription
chunkUint8ArrayThe byte chunk to write.

Returns

Promise<void>

Implementation of

ByteSink.write

On this page