Package nl.tue.storage.compressor
Class ByteListCompressor
- java.lang.Object
-
- nl.tue.storage.compressor.AbstractFixedLengthListCompressor<java.lang.Byte>
-
- nl.tue.storage.compressor.ByteListCompressor
-
- All Implemented Interfaces:
Deflater<java.util.List<java.lang.Byte>>,EqualOperation<java.util.List<java.lang.Byte>>,HashOperation<java.util.List<java.lang.Byte>>,Inflater<java.util.List<java.lang.Byte>>
public class ByteListCompressor extends AbstractFixedLengthListCompressor<java.lang.Byte>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface nl.tue.storage.EqualOperation
EqualOperation.Default<K>
-
Nested classes/interfaces inherited from interface nl.tue.storage.HashOperation
HashOperation.Default<K>
-
-
Field Summary
-
Fields inherited from class nl.tue.storage.compressor.AbstractFixedLengthListCompressor
length
-
-
Constructor Summary
Constructors Constructor Description ByteListCompressor(int length)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.BytefromByteArray(byte[] bytes)reads an object of type K from an array of bytes of size numBytes()intgetMaxByteCount()the method is called before each call to deflate.protected booleanisZero(java.lang.Byte number)Indicates if the given number equals 0protected java.lang.Byte[]newEmptyArray(int length)Instantiates a new array of the given length, such that for all elements, isZero() returns true.protected intnumBytes()returns the number of bytes for storing one object of type Kprotected byte[]toByteArray(java.lang.Byte number)writes an object of type K to an array of bytes, of size numBytes();-
Methods inherited from class nl.tue.storage.compressor.AbstractFixedLengthListCompressor
deflate, deflateHead, equals, getBitMask, getHashCode, getHashCode, inflate, inflateContent, readMask
-
-
-
-
Method Detail
-
isZero
protected boolean isZero(java.lang.Byte number)
Description copied from class:AbstractFixedLengthListCompressorIndicates if the given number equals 0- Specified by:
isZeroin classAbstractFixedLengthListCompressor<java.lang.Byte>- Returns:
-
numBytes
protected int numBytes()
Description copied from class:AbstractFixedLengthListCompressorreturns the number of bytes for storing one object of type K- Specified by:
numBytesin classAbstractFixedLengthListCompressor<java.lang.Byte>- Returns:
-
toByteArray
protected byte[] toByteArray(java.lang.Byte number)
Description copied from class:AbstractFixedLengthListCompressorwrites an object of type K to an array of bytes, of size numBytes();- Specified by:
toByteArrayin classAbstractFixedLengthListCompressor<java.lang.Byte>- Returns:
-
fromByteArray
protected java.lang.Byte fromByteArray(byte[] bytes)
Description copied from class:AbstractFixedLengthListCompressorreads an object of type K from an array of bytes of size numBytes()- Specified by:
fromByteArrayin classAbstractFixedLengthListCompressor<java.lang.Byte>- Returns:
-
newEmptyArray
protected java.lang.Byte[] newEmptyArray(int length)
Description copied from class:AbstractFixedLengthListCompressorInstantiates a new array of the given length, such that for all elements, isZero() returns true.- Specified by:
newEmptyArrayin classAbstractFixedLengthListCompressor<java.lang.Byte>- Returns:
-
getMaxByteCount
public int getMaxByteCount()
Description copied from interface:Deflaterthe 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- Returns:
-
-