Interface PageCompressor
- All Superinterfaces:
 AutoCloseable, Closeable
Compresses and decompresses pages. Instances aren't expected to be thread-safe.
- 
Method Summary
Modifier and TypeMethodDescriptionvoidclose()intcompress(long srcAddr, int srcOff, int srcLen) Compress to a byte array from a raw memory address.byte[]Target of the compress method.voiddecompress(byte[] src, int srcOff, int srcLen, long dstAddr, int dstOff, int dstLen) Decompress to a raw memory address.static Supplier<PageCompressor> lz4()Returns a supplier of new LZ4 compressors.static Supplier<PageCompressor> zlib()Returns a supplier of new ZLIB compressors (deflate).static Supplier<PageCompressor> zlib(int level) Returns a supplier of new ZLIB compressors (deflate).static Supplier<PageCompressor> zstd()Returns a supplier of new Zstandard compressors.static Supplier<PageCompressor> zstd(int level) Returns a supplier of new Zstandard compressors. 
- 
Method Details
- 
zlib
Returns a supplier of new ZLIB compressors (deflate). - 
zlib
Returns a supplier of new ZLIB compressors (deflate).- Parameters:
 level- compression level [0..9]
 - 
lz4
Returns a supplier of new LZ4 compressors. - 
zstd
Returns a supplier of new Zstandard compressors. The native zstd library isn't provided by this class, and so it must be installed separately. - 
zstd
Returns a supplier of new Zstandard compressors. The native zstd library isn't provided by this class, and so it must be installed separately.- Parameters:
 level- compression level [1..22]
 - 
compress
Compress to a byte array from a raw memory address.- Returns:
 - the compressed size
 - Throws:
 IOException
 - 
compressedBytes
byte[] compressedBytes()Target of the compress method. The array is recycled, although it can be replaced. - 
decompress
void decompress(byte[] src, int srcOff, int srcLen, long dstAddr, int dstOff, int dstLen) throws IOException Decompress to a raw memory address.- Parameters:
 dstLen- original size of uncompressed page- Throws:
 IOException
 - 
close
void close()- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable
 
 -