Class Uncompressor

  • Direct Known Subclasses:
    GZIPUncompressor, LZFUncompressor

    public abstract class Uncompressor
    extends java.lang.Object
    Abstract class that defines "push" style API for various uncompressors (aka decompressors or decoders). Implementations are alternatives to stream based uncompressors (such as LZFInputStream) in cases where "push" operation is important and/or blocking is not allowed; for example, when handling asynchronous HTTP responses.

    Note that API does not define the way that listener is attached: this is typically passed through to constructor of the implementation.

    • Constructor Summary

      Constructors 
      Constructor Description
      Uncompressor()  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract void complete()
      Method called to indicate that all data to uncompress has already been fed.
      abstract boolean feedCompressedData​(byte[] comp, int offset, int len)
      Method called to feed more compressed data to be uncompressed, and sent to possible listeners.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Uncompressor

        public Uncompressor()
    • Method Detail

      • feedCompressedData

        public abstract boolean feedCompressedData​(byte[] comp,
                                                   int offset,
                                                   int len)
                                            throws java.io.IOException
        Method called to feed more compressed data to be uncompressed, and sent to possible listeners.

        NOTE: return value was added (from void to boolean) in 0.9.9

        Returns:
        True, if caller should process and feed more data; false if caller is not interested in more data and processing should be terminated. (and complete() should be called immediately)
        Throws:
        java.io.IOException
      • complete

        public abstract void complete()
                               throws java.io.IOException
        Method called to indicate that all data to uncompress has already been fed. This typically results in last block of data being uncompressed, and results being sent to listener(s); but may also throw an exception if incomplete block was passed.
        Throws:
        java.io.IOException