org.caleigo.toolkit.tunnel
Class ZipPacker.ZipPackerInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended byorg.caleigo.toolkit.tunnel.ZipPacker.ZipPackerInputStream
Enclosing class:
ZipPacker

protected class ZipPacker.ZipPackerInputStream
extends java.io.FilterInputStream

Uses a ZipInputStream to read and unzip data from an InputStream. It uses a circular buffer to store the unziped data.


Field Summary
protected  CircularByteBuffer mDecompressedByteBuffer
           
protected  byte[] mInByteBuffer
           
protected  byte[] mSingleByteBuffer
           
protected  java.util.zip.ZipInputStream mZipInputStream
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
ZipPacker.ZipPackerInputStream(java.io.InputStream in, int bufferSize)
          Creates a ZipPackerInputStream that wrapps an InputStream.
 
Method Summary
 int available()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
protected  void readFromZipStream()
           
 
Methods inherited from class java.io.FilterInputStream
close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mInByteBuffer

protected byte[] mInByteBuffer

mSingleByteBuffer

protected byte[] mSingleByteBuffer

mDecompressedByteBuffer

protected CircularByteBuffer mDecompressedByteBuffer

mZipInputStream

protected java.util.zip.ZipInputStream mZipInputStream
Constructor Detail

ZipPacker.ZipPackerInputStream

public ZipPacker.ZipPackerInputStream(java.io.InputStream in,
                                      int bufferSize)
Creates a ZipPackerInputStream that wrapps an InputStream.

Parameters:
in - the InputStream that should be used to read the zipped data to from.
bufferSize - the initial size of the internal buffer. The size of the buffer is increased as needed. Each time the buffer needs to be resized its size is increased by bufferSize / 2 bytes.
Method Detail

available

public int available()
              throws java.io.IOException
Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Throws:
java.io.IOException

readFromZipStream

protected void readFromZipStream()
                          throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2005 Caleigo. All Rights Reserved.