Class CompressableCompressor<C extends Compressable>

    • Constructor Summary

      Constructors 
      Constructor Description
      CompressableCompressor​(java.lang.Class<C> clazz)
      The compressor needs to be able to instantiate objects of the class .
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void deflate​(C object, java.io.OutputStream stream)
      deflate the given object into the provided stream.
      boolean equals​(C object, CompressedStore<C> store, long l)
      Check for equality between a given object and a location in the store.
      int getHashCode​(C object)
      Return the hashCode of the object
      int getHashCode​(CompressedStore<C> store, long l)
      Retrieve the object from the store and return its hashCode.
      int getMaxByteCount()
      the method is called before each call to deflate.
      C inflate​(java.io.InputStream stream)
      read an object from a stream.
      • Methods inherited from class java.lang.Object

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

      • CompressableCompressor

        public CompressableCompressor​(java.lang.Class<C> clazz)
        The compressor needs to be able to instantiate objects of the class . Therefore, the class needs to be provided in the constructor and this class should have an empty constructor, i.e. a constructor without parameters.
        Parameters:
        clazz -
    • Method Detail

      • inflate

        public C inflate​(java.io.InputStream stream)
                  throws java.io.IOException
        Description copied from interface: Inflater
        read an object from a stream. The inflater should know when to stop reading and should NOT close the stream;
        Specified by:
        inflate in interface Inflater<C extends Compressable>
        Returns:
        Throws:
        java.io.IOException
      • deflate

        public void deflate​(C object,
                            java.io.OutputStream stream)
                     throws java.io.IOException
        Description copied from interface: Deflater
        deflate the given object into the provided stream. This method should NOT close the stream.
        Specified by:
        deflate in interface Deflater<C extends Compressable>
        Throws:
        java.io.IOException
      • getHashCode

        public int getHashCode​(C object)
        Return the hashCode of the object
        Specified by:
        getHashCode in interface HashOperation<C extends Compressable>
        Parameters:
        object -
        Returns:
      • getMaxByteCount

        public int getMaxByteCount()
        Description copied from interface: Deflater
        the method is called before each call to deflate. The call to deflate should not write more than the number of bytes returned by this method! It may write less. If a negative value is returned, then a resizeable buffer is used
        Specified by:
        getMaxByteCount in interface Deflater<C extends Compressable>
        Returns: