iText 9.8.0 API
iText.IO.Source.IFinishable Interface Reference

Interface for output streams that supports finalization without closing the underlying stream. More...

Inheritance diagram for iText.IO.Source.IFinishable:
iText.Brotlicompressor.BrotliOutputStream iText.IO.Source.ASCII85OutputStream iText.IO.Source.ASCIIHexOutputStream iText.IO.Source.DeflaterOutputStream iText.IO.Source.RunLengthOutputStream

Public Member Functions

void  Finish ()
  Is called to finalize the stream, implementing classes should ensure that the underlying output stream remains open after this method is called. More...
 

Detailed Description

Interface for output streams that supports finalization without closing the underlying stream.

Interface for output streams that supports finalization without closing the underlying stream.

This interface is designed for output streams that wrap other streams and need to complete their processing (such as finishing compression, flushing buffers, or writing final data) without closing the underlying output stream. This is particularly useful when multiple operations need to be performed on the same underlying stream sequentially.

Implementations of this interface should ensure that calling Finish() completes all pending operations and releases any resources associated with the stream processing, but does not close the underlying stream.

See also
DeflaterOutputStream, System.IO.Stream.Dispose()

Member Function Documentation

◆ Finish()

void iText.IO.Source.IFinishable.Finish ( )

Is called to finalize the stream, implementing classes should ensure that the underlying output stream remains open after this method is called.

Is called to finalize the stream, implementing classes should ensure that the underlying output stream remains open after this method is called.

This method completes any pending write operations, flushes internal buffers, writes any final data required by the stream format, and releases resources associated with the stream processing. However, unlike System.IO.Stream.Dispose() , it does not close the underlying output stream.

After calling this method, no further data should be written to this stream, but the underlying stream remains open and can be used for other operations.

This method should be idempotent - calling it multiple times should have the same effect as calling it once.

Implemented in iText.IO.Source.RunLengthOutputStream, iText.IO.Source.ASCII85OutputStream, iText.IO.Source.ASCIIHexOutputStream, and iText.Brotlicompressor.BrotliOutputStream.