iText 9.8.0 API
iText.Brotlicompressor.BrotliOutputStream Class Reference

An output stream that compresses data using the Brotli compression algorithm. More...

Inheritance diagram for iText.Brotlicompressor.BrotliOutputStream:
iText.IO.Source.IFinishable

Public Member Functions

  BrotliOutputStream (Stream stream, CompressionLevel compressionLevel)
  Initializes a new instance of the BrotliOutputStream class with the specified stream and compression level. More...
 
virtual void  Finish ()
  Finishes writing compressed data to the underlying stream. More...
 
override void  Flush ()
  Clears all buffers for this stream and causes any buffered data to be written to the underlying device. More...
 
override int  Read (byte[] buffer, int offset, int count)
  Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. More...
 
override long  Seek (long offset, SeekOrigin origin)
  Sets the position within the current stream. More...
 
override void  SetLength (long value)
  Sets the length of the current stream. More...
 
override void  Write (byte[] buffer, int offset, int count)
  Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. More...
 

Public Attributes

override bool  CanRead => internalBrotliStream.CanRead
  Gets a value indicating whether the current stream supports reading. More...
 
override bool  CanSeek => internalBrotliStream.CanSeek
  Gets a value indicating whether the current stream supports seeking. More...
 
override bool  CanWrite => internalBrotliStream.CanWrite
  Gets a value indicating whether the current stream supports writing. More...
 
override long  Length => internalBrotliStream.Length
  Gets the length in bytes of the stream. More...
 

Properties

override long  Position [get, set]
  Gets or sets the position within the current stream. More...
 

Detailed Description

An output stream that compresses data using the Brotli compression algorithm.

This is a wrapper around System.IO.Compression.BrotliStream that implements the iText.IO.Source.IFinishable interface, allowing it to be used in contexts where finalization without closing the underlying stream is required.

Constructor & Destructor Documentation

◆ BrotliOutputStream()

iText.Brotlicompressor.BrotliOutputStream.BrotliOutputStream ( Stream  stream,
CompressionLevel  compressionLevel 
)
inline

Initializes a new instance of the BrotliOutputStream class with the specified stream and compression level.

Parameters
stream The underlying stream to write compressed data to.
compressionLevel The compression level to use.

Member Function Documentation

◆ Finish()

virtual void iText.Brotlicompressor.BrotliOutputStream.Finish ( )
inlinevirtual

Finishes writing compressed data to the underlying stream.

This method finalizes the compression and flushes any remaining data to the underlying stream. The underlying stream is not closed.

Implements iText.IO.Source.IFinishable.

◆ Flush()

override void iText.Brotlicompressor.BrotliOutputStream.Flush ( )
inline

Clears all buffers for this stream and causes any buffered data to be written to the underlying device.

◆ Read()

override int iText.Brotlicompressor.BrotliOutputStream.Read ( byte[]  buffer,
int  offset,
int  count 
)
inline

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

Parameters
buffer An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source.
offset The zero-based byte offset in buffer at which to begin storing the data read from the current stream.
count The maximum number of bytes to be read from the current stream.
Returns
The total number of bytes read into the buffer.

◆ Seek()

override long iText.Brotlicompressor.BrotliOutputStream.Seek ( long  offset,
SeekOrigin  origin 
)
inline

Sets the position within the current stream.

Parameters
offset A byte offset relative to the origin parameter.
origin A value of type SeekOrigin indicating the reference point used to obtain the new position.
Returns
The new position within the current stream.

◆ SetLength()

override void iText.Brotlicompressor.BrotliOutputStream.SetLength ( long  value )
inline

Sets the length of the current stream.

Parameters
value The desired length of the current stream in bytes.

◆ Write()

override void iText.Brotlicompressor.BrotliOutputStream.Write ( byte[]  buffer,
int  offset,
int  count 
)
inline

Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written.

Parameters
buffer An array of bytes. This method copies count bytes from buffer to the current stream.
offset The zero-based byte offset in buffer at which to begin copying bytes to the current stream.
count The number of bytes to be written to the current stream.

Member Data Documentation

◆ CanRead

override bool iText.Brotlicompressor.BrotliOutputStream.CanRead => internalBrotliStream.CanRead

Gets a value indicating whether the current stream supports reading.

◆ CanSeek

override bool iText.Brotlicompressor.BrotliOutputStream.CanSeek => internalBrotliStream.CanSeek

Gets a value indicating whether the current stream supports seeking.

◆ CanWrite

override bool iText.Brotlicompressor.BrotliOutputStream.CanWrite => internalBrotliStream.CanWrite

Gets a value indicating whether the current stream supports writing.

◆ Length

override long iText.Brotlicompressor.BrotliOutputStream.Length => internalBrotliStream.Length

Gets the length in bytes of the stream.

Property Documentation

◆ Position

override long iText.Brotlicompressor.BrotliOutputStream.Position
getset

Gets or sets the position within the current stream.