Package 

Class StreamCompressor

  • All Implemented Interfaces:
    java.io.Closeable , java.lang.AutoCloseable

    
    public abstract class StreamCompressor
     implements Closeable
                        

    Encapsulates a Deflater and crc calculator, handling multiple types of output streams. Currently DEFLATED and STORED are the only supported compression methods.

    • Method Detail

      • deflate

         void deflate(InputStream source, int method)

        Deflate the given source using the supplied compression method

        Parameters:
        source - The source to compress
        method - The #ZipArchiveEntry compression method
      • getBytesRead

         long getBytesRead()

        Return the number of bytes read from the source stream

      • getCrc32

         long getCrc32()

        The crc32 of the last deflated file

      • getTotalBytesWritten

         long getTotalBytesWritten()

        The total number of bytes written to the output for all files