public class DeflateEncoder extends java.lang.Object implements ImageEncoder
Constructor and Description |
---|
DeflateEncoder(java.io.OutputStream os,
int bufferSize,
int compressLevel) |
DeflateEncoder(java.io.OutputStream os,
int bufferSize,
int compressLevel,
Updatable<java.lang.Integer> writer) |
Modifier and Type | Method and Description |
---|---|
void |
encode(byte[] pixels,
int start,
int len)
The actual encoding implementation
|
void |
finish() |
int |
getCompressedDataLen() |
void |
initialize() |
public DeflateEncoder(java.io.OutputStream os, int bufferSize, int compressLevel)
public DeflateEncoder(java.io.OutputStream os, int bufferSize, int compressLevel, Updatable<java.lang.Integer> writer)
public void encode(byte[] pixels, int start, int len) throws java.lang.Exception
ImageEncoder
encode
in interface ImageEncoder
pixels
- array of pixels (This has nothing to do with the actual bits per pixel since it could be pixel packed)start
- offset in the pixel array where the encoding starts (the actual position could be anywhere inside the
offset byte which maybe kept track of by the implementation class through a parameter such as
currPos if the encoder is pixel oriented).len
- the number of pixels to be encoded if the encoder is pixel oriented like CCITT or the number of bytes to
be encoded if the encoder is byte oriented like LZW etc.java.lang.Exception
public void finish() throws java.lang.Exception
finish
in interface ImageEncoder
java.lang.Exception
public int getCompressedDataLen()
getCompressedDataLen
in interface ImageEncoder
public void initialize() throws java.lang.Exception
initialize
in interface ImageEncoder
java.lang.Exception