writeToInternalBuffer

Provides direct access to the sink's internal buffer and hints its emit before exit.

The internal buffer is passed into lambda, and it may be partially emitted to the underlying sink before returning from this method.

Use this method with care as the data within the buffer is not yet emitted to the underlying sink and consumption of data from the buffer will cause its loss.

Parameters

lambda

the callback accessing internal buffer.

Throws

when the sink is closed.

when some I/O error occurs.