Class: BufferSink
Streaming output contract implemented by sinks that receive generated PDF byte chunks.
Implements
Constructors
Constructor
new BufferSink(options?): BufferSink;
Creates a memory-backed byte sink with an optional capacity limit.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | BufferSinkOptions | Options that control the sink behavior. |
Returns
BufferSink
Methods
close()
close(): Promise<void>;
Marks the sink as closed so no more chunks can be written.
Returns
Promise<void>
Implementation of
collect()
collect(): Uint8Array;
Combines all collected chunks into a single Uint8Array.
Returns
Uint8Array
The collected bytes.
write()
write(chunk): Promise<void>;
Stores a streamed byte chunk in memory.
Parameters
| Parameter | Type | Description |
|---|---|---|
chunk | Uint8Array | The byte chunk to write. |
Returns
Promise<void>