A synchronous writable stream

interface ISyncWritable {
    disposeWriteSync: (written?: number) => void;
    writeSync: (bytes: number) => Uint8Array;
}

Implemented by

Properties

disposeWriteSync: (written?: number) => void

Explicitly dispose of the buffer that was returned by the last call to writeSync.

If less than bytes bytes were written to the buffer, the number of bytes that were written must be passed as the written argument.

writeSync: (bytes: number) => Uint8Array

Write the specified number of bytes to the underlying source.

The implementation is supposed to make sure there are at least bytes bytes available in the underlying source and return a Uint8Array that can be written to. The returned Uint8Array must be valid at least until the next call to writeSync or disposeWriteSync.

If the caller writes less than bytes bytes to the returned Uint8Array, disposeWriteSync must be called with the number of bytes that were actually written.

Type declaration

    • (bytes: number): Uint8Array
    • Parameters

      • bytes: number

        The number of bytes to write

      Returns Uint8Array

      Uint8Array of length bytes that can be written to