Class FastLZOutputStream

    • Constructor Summary

      Constructors 
      Constructor Description
      FastLZOutputStream​(OutputStream stream, int compressionLevel)
      Initializes a new instance of the FastLZStream class prepared for compression.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.
      void flush()
      Clears all buffers for this stream and causes any buffered data to be written to the underlying device.
      void write​(byte[] buffer, int offset, int count)
      Writes a sequence of bytes to the compressing stream and advances the current position within this stream by the number of bytes written.
      void write​(int b)
      Writes the specified byte to this output stream.
    • Constructor Detail

      • FastLZOutputStream

        public FastLZOutputStream​(OutputStream stream,
                                  int compressionLevel)

        Initializes a new instance of the FastLZStream class prepared for compression.

        Parameters:
        stream - the stream for saving compressed data
        compressionLevel - use 1 for faster compression, use 2 for better compression ratio
        Throws:
        com.aspose.ms.System.ArgumentNullException - stream is null.
        com.aspose.ms.System.ArgumentException - stream does not support writing.
        com.aspose.ms.System.ArgumentOutOfRangeException - compressionLevel is more than 2 or less than 1.
    • Method Detail

      • write

        public void write​(int b)
        Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.
        Specified by:
        write in class OutputStream
        Parameters:
        b - the byte
      • write

        public void write​(byte[] buffer,
                          int offset,
                          int count)

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

        Overrides:
        write in class OutputStream
        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
      • flush

        public void flush()

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

        Specified by:
        flush in interface Flushable
        Overrides:
        flush in class OutputStream
      • close

        public void close()

        Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream.

        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Overrides:
        close in class OutputStream