public abstract class AbstractCompressionCodec extends java.lang.Object implements CompressionCodec
构造器和说明 |
---|
AbstractCompressionCodec() |
限定符和类型 | 方法和说明 |
---|---|
byte[] |
compress(byte[] payload)
Asserts that payload is not null and calls
doCompress |
byte[] |
decompress(byte[] compressed)
Asserts the compressed bytes is not null and calls
doDecompress |
protected abstract byte[] |
doCompress(byte[] payload)
Implement this method to do the actual work of compressing the payload
|
protected abstract byte[] |
doDecompress(byte[] compressed)
Implement this method to do the actual work of decompressing the compressed bytes.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAlgorithmName
protected abstract byte[] doCompress(byte[] payload) throws java.io.IOException
payload
- the bytes to compressjava.io.IOException
- if the compression causes an IOExceptionpublic final byte[] compress(byte[] payload)
doCompress
compress
在接口中 CompressionCodec
payload
- bytes to compressCompressionException
- if doCompress
throws an IOExceptionpublic final byte[] decompress(byte[] compressed)
doDecompress
decompress
在接口中 CompressionCodec
compressed
- compressed bytesCompressionException
- if doDecompress
throws an IOExceptionprotected abstract byte[] doDecompress(byte[] compressed) throws java.io.IOException
compressed
- compressed bytesjava.io.IOException
- if the decompression runs into an IO problem