org.caleigo.toolkit.tunnel
Class CRCPacker.CRCPackerInputStream

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

protected class CRCPacker.CRCPackerInputStream
extends java.io.FilterInputStream


Field Summary
protected  java.util.zip.CRC32 checker
           
protected  CircularByteBuffer mCheckedByteBuffer
           
protected  byte[] mInByteBuffer
           
protected  java.io.ObjectInputStream mObjectInputStream
           
protected  byte[] mSingleByteBuffer
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
CRCPacker.CRCPackerInputStream(java.io.InputStream in, int bufferSize)
          Creates a CRCPackerInputStream that wrapps an InputStream.
 
Method Summary
 int available()
           
 int read()
           
 int read(byte[] b, int off, int len)
           
protected  void readFromCheckedStream()
           
 
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

mCheckedByteBuffer

protected CircularByteBuffer mCheckedByteBuffer

checker

protected java.util.zip.CRC32 checker

mObjectInputStream

protected java.io.ObjectInputStream mObjectInputStream
Constructor Detail

CRCPacker.CRCPackerInputStream

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

Parameters:
in - the InputStream that should be used to read the 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

readFromCheckedStream

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


Copyright © 2005 Caleigo. All Rights Reserved.