Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.javax.crypto.assembly
Class DeflateTransformer  view DeflateTransformer download DeflateTransformer.java

java.lang.Object
  extended bygnu.javax.crypto.assembly.Transformer
      extended bygnu.javax.crypto.assembly.DeflateTransformer

class DeflateTransformer
extends Transformer

A Transformer Adapter allowing inclusion of a DEFLATE compression algorithm in an Assembly chain. The Direction.FORWARD 55 transformation is a compression (deflate) of input data, while the Direction.REVERSED 55 one is a decompression (inflate) that restores the original data.

This Transformer uses a java.util.zip.Deflater instance to carry on the compression, and an java.util.zip.Inflater to do the decompression.

When using such a Transformer, in an Assembly, there must be at least one element behind this instance in the constructed chain; otherwise, a TransformerException is thrown at initialisation time.

Version:
Revision: $

Field Summary
private  java.util.zip.Deflater compressor
           
private  java.util.zip.Inflater decompressor
           
private  int outputBlockSize
           
private  byte[] zlibBuffer
           
 
Fields inherited from class gnu.javax.crypto.assembly.Transformer
DIRECTION, inBuffer, mode, outBuffer, tail, wired
 
Constructor Summary
(package private) DeflateTransformer()
           
 
Method Summary
private  void compress()
           
private  void decompress(byte[] in, int offset, int length)
           
(package private)  int delegateBlockSize()
           
(package private)  void initDelegate(java.util.Map attributes)
           
(package private)  byte[] lastUpdateDelegate()
           
(package private)  void resetDelegate()
           
(package private)  byte[] updateDelegate(byte[] in, int offset, int length)
           
 
Methods inherited from class gnu.javax.crypto.assembly.Transformer
currentBlockSize, getCascadeTransformer, getDeflateTransformer, getPaddingTransformer, init, isPostProcessing, isPreProcessing, lastUpdate, lastUpdate, lastUpdate, lastUpdate, reset, setMode, update, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

compressor

private java.util.zip.Deflater compressor

decompressor

private java.util.zip.Inflater decompressor

outputBlockSize

private int outputBlockSize

zlibBuffer

private byte[] zlibBuffer
Constructor Detail

DeflateTransformer

DeflateTransformer()
Method Detail

initDelegate

void initDelegate(java.util.Map attributes)
            throws TransformerException
Specified by:
initDelegate in class Transformer

delegateBlockSize

int delegateBlockSize()
Specified by:
delegateBlockSize in class Transformer

resetDelegate

void resetDelegate()
Specified by:
resetDelegate in class Transformer

updateDelegate

byte[] updateDelegate(byte[] in,
                      int offset,
                      int length)
                throws TransformerException
Specified by:
updateDelegate in class Transformer

lastUpdateDelegate

byte[] lastUpdateDelegate()
                    throws TransformerException
Specified by:
lastUpdateDelegate in class Transformer

compress

private void compress()

decompress

private void decompress(byte[] in,
                        int offset,
                        int length)
                 throws TransformerException