ewe.zip
Class InflaterInputStream

java.lang.Object
  extended byewe.util.Errorable
      extended byewe.io.BasicStreamObject
          extended byewe.io.StreamObject
              extended byewe.zip.InflaterInputStream
All Implemented Interfaces:
BasicStream, Stream, Streamable

public class InflaterInputStream
extends StreamObject


Field Summary
protected  ByteArray byteIn
           
protected  ByteArray byteOut
           
protected  BasicStream input
           
protected  Object reserved
          Don't use this.
protected static int Z_BUF_ERROR
           
protected static int Z_DATA_ERROR
           
protected static int Z_ERRNO
           
protected static int Z_MEM_ERROR
           
protected static int Z_NEED_DICT
           
protected static int Z_OK
           
protected static int Z_STREAM_END
           
protected static int Z_STREAM_ERROR
           
protected static int Z_VERSION_ERROR
           
 
Fields inherited from class ewe.io.StreamObject
napIterations, napTime, READWRITE_CLOSED, READWRITE_ERROR, READWRITE_WOULDBLOCK
 
Fields inherited from class ewe.io.BasicStreamObject
closed
 
Fields inherited from class ewe.util.Errorable
error
 
Constructor Summary
InflaterInputStream(BasicStream input)
           
InflaterInputStream(BasicStream input, boolean noWrap)
           
InflaterInputStream(InputStream input)
           
InflaterInputStream(InputStream input, boolean noWrap)
           
 
Method Summary
 boolean closeStream()
          This is non-blocking.
 boolean flushStream()
          This is non-blocking.
protected  int inflate(ByteArray in, ByteArray out)
           
protected  int inflateEnd()
           
protected  int inflateInit(boolean noWrap)
           
 int nonBlockingRead(byte[] buff, int start, int count)
          This is the non-blocking read operation.
 void setBufferSize(int size)
          Don't call this after starting to read input!
 
Methods inherited from class ewe.io.StreamObject
close, doRead, doWrite, flush, isOpen, nap, nap, nonBlockingWrite, read, readAByte, readBytes, readBytes, write, writeAByte, writeBytes, writeBytes
 
Methods inherited from class ewe.io.BasicStreamObject
getException, getName, read, read, throwIOException, toInputStream, toOutputStream, toStream, write, write
 
Methods inherited from class ewe.util.Errorable
returnError, returnError, returnError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, toString
 

Field Detail

reserved

protected Object reserved
Don't use this. It is a placeholder for a native resource.


byteIn

protected ByteArray byteIn

byteOut

protected ByteArray byteOut

input

protected BasicStream input

Z_OK

protected static final int Z_OK
See Also:
Constant Field Values

Z_STREAM_END

protected static final int Z_STREAM_END
See Also:
Constant Field Values

Z_NEED_DICT

protected static final int Z_NEED_DICT
See Also:
Constant Field Values

Z_ERRNO

protected static final int Z_ERRNO
See Also:
Constant Field Values

Z_STREAM_ERROR

protected static final int Z_STREAM_ERROR
See Also:
Constant Field Values

Z_DATA_ERROR

protected static final int Z_DATA_ERROR
See Also:
Constant Field Values

Z_MEM_ERROR

protected static final int Z_MEM_ERROR
See Also:
Constant Field Values

Z_BUF_ERROR

protected static final int Z_BUF_ERROR
See Also:
Constant Field Values

Z_VERSION_ERROR

protected static final int Z_VERSION_ERROR
See Also:
Constant Field Values
Constructor Detail

InflaterInputStream

public InflaterInputStream(BasicStream input)

InflaterInputStream

public InflaterInputStream(BasicStream input,
                           boolean noWrap)

InflaterInputStream

public InflaterInputStream(InputStream input,
                           boolean noWrap)

InflaterInputStream

public InflaterInputStream(InputStream input)
Method Detail

setBufferSize

public void setBufferSize(int size)
Don't call this after starting to read input!


inflateInit

protected int inflateInit(boolean noWrap)

inflate

protected int inflate(ByteArray in,
                      ByteArray out)

inflateEnd

protected int inflateEnd()

nonBlockingRead

public int nonBlockingRead(byte[] buff,
                           int start,
                           int count)
Description copied from class: StreamObject
This is the non-blocking read operation. It should never attempt to wait() or sleep() in a Coroutine. It should return as quickly as possible. This makes it safe to be called from within a native method. Note that this should NEVER be called with a count of zero.

The default StreamObject implementation of this uses the single byte read() method.

Specified by:
nonBlockingRead in interface BasicStream
Overrides:
nonBlockingRead in class StreamObject
Parameters:
buff - Destination byte array to hold incoming data.
start - Starting index in buff for incoming data.
count - Maximum number of bytes to read - should never be zero.
Returns:
greater than 0 = Number of bytes read.
0 = No bytes available to read at this time.
-1 = Stream end reached no further bytes to read.
-2 = IO Error.
Note that these values are different to the Stream.readBytes method.

closeStream

public boolean closeStream()
                    throws IOException
Description copied from interface: BasicStream
This is non-blocking. It returns true if the close completed, false if it did not, or throws an exception on error.

Specified by:
closeStream in interface BasicStream
Overrides:
closeStream in class StreamObject
Throws:
IOException

flushStream

public boolean flushStream()
                    throws IOException
Description copied from interface: BasicStream
This is non-blocking. It returns true if the flush completed, false if it did not, or throws an exception on error.

Throws:
IOException