public class ZlibDeflate extends Object
Utility class to compress/decompress bytes using the ZLIB deflate/inflate compression.
RFC 1951 - DEFLATE Compressed Data Format Specification version 1.3
Constructor and Description |
---|
ZlibDeflate() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
compress(byte[] bytes)
Compress the byte[] using ZLIB deflate compression.
|
static byte[] |
decompress(byte[] bytes,
int expectedSize)
Compress the byte[] using ZLIB deflate decompression.
|
public static byte[] decompress(byte[] bytes, int expectedSize) throws ImageReadException
bytes
- The bytes to decompressexpectedSize
- The expected size of the decompressed byte[].ImageReadException
- if the bytes could not be decompressed.Inflater
public static byte[] compress(byte[] bytes) throws ImageWriteException
bytes
- The bytes to compressImageWriteException
- if the bytes could not be compressed.DeflaterOutputStream
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.