Package org.jpedal.io.filter
Class Flate
java.lang.Object
com.idrsolutions.image.filter.Filter
org.jpedal.io.filter.Flate
Flate
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
decode
(byte[] data) Flate decode - use a byte array stream to decompress data in memoryvoid
decode
(BufferedInputStream bis, BufferedOutputStream streamCache, String cacheName, Map<String, String> cachedObjects) Flate decodebyte[]
encode
(byte[] data) Flate encodestatic byte[]
encode
(byte[] data, int compressionLevel) Flate encodevoid
encode
(BufferedInputStream bis, BufferedOutputStream bos) Flate encoding for Streams is currently unsupportedstatic byte[]
encodeLF
(byte[] data, int compressionLevel) Flate encode with an LF appended to the end.static byte[]
encodeLF
(ByteBuffer data, int compressionLevel) Flate encode with an LF appended to the end.boolean
hasError()
inherited by several methodsMethods inherited from class com.idrsolutions.image.filter.Filter
setEncHash, setupCachedObjectForDecoding
-
Constructor Details
-
Flate
-
-
Method Details
-
decode
Flate decode - use a byte array stream to decompress data in memory -
decode
public void decode(BufferedInputStream bis, BufferedOutputStream streamCache, String cacheName, Map<String, String> cachedObjects) throws ExceptionFlate decode -
encode
public byte[] encode(byte[] data) Flate encode -
encode
public static byte[] encode(byte[] data, int compressionLevel) Flate encode- Parameters:
data
- the byte[] to be compressedcompressionLevel
- the level of compression- Returns:
- a byte[] of compressed data
-
encodeLF
public static byte[] encodeLF(byte[] data, int compressionLevel) Flate encode with an LF appended to the end.Note that the LF is not part of the stream so when setting the stream Length in the dictionary, use (length - 1)
- Parameters:
data
- the byte[] to be compressedcompressionLevel
- the level of compression- Returns:
- a byte[] of compressed data
-
encodeLF
Flate encode with an LF appended to the end.Note that the LF is not part of the stream so when setting the stream Length in the dictionary, use (length - 1)
- Parameters:
data
- the ByteBuffer to be compressedcompressionLevel
- the level of compression- Returns:
- a byte[] of compressed data
-
encode
Flate encoding for Streams is currently unsupported -
hasError
public boolean hasError()Description copied from class:Filter
inherited by several methods
-