Top Description Fields Constructors Methods
com.jcraft.jzlib

public Class ZInputStream

extends FilterInputStream
Class Inheritance
Annotations
@Deprecated
Imports
java.io.*

Deprecated

use DeflaterOutputStream or InflaterInputStream

ZInputStream

Field Summary

Modifier and TypeField and Description
private byte[]
private byte[]
protected boolean
protected Deflater
deflater

Deprecated as a consequence of Deflater being deprecated.
protected int
protected InflaterInputStream
protected InputStream

Constructor Summary

AccessConstructor and Description
public
public
ZInputStream(InputStream in, boolean nowrap)

public
ZInputStream(InputStream in, int level)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.FilterInputStream.close.

Implements java.io.Closeable.close.

Closes this input stream and releases any system resources associated with the stream.
public int
public long
public long
public int
read()

Overrides java.io.FilterInputStream.read.

Reads the next byte of data from the input stream.
public int
read(byte[]
the buffer into which the data is read.
b
,
int
the start offset in array b at which the data is written.
off
,
int
the maximum number of bytes to read.
len
)

Overrides java.io.FilterInputStream.read.

Reads up to len bytes of data from this input stream into an array of bytes.
public void
setFlushMode(int flush)

public long
skip(long
the number of bytes to be skipped.
n
)

Overrides java.io.FilterInputStream.skip.

Skips over and discards n bytes of data from the input stream.
Inherited from java.io.FilterInputStream:
availablemarkmarkSupportedreadreset

Field Detail

bufback to summary
private byte[] buf
buf1back to summary
private byte[] buf1
compressback to summary
protected boolean compress
deflaterback to summary
protected Deflater deflater

Deprecated

as a consequence of Deflater being deprecated. See corresponding docs for further information.

flushback to summary
protected int flush
iisback to summary
protected InflaterInputStream iis
inback to summary
protected InputStream in

Hides java.io.FilterInputStream.in.

Constructor Detail

ZInputStreamback to summary
public ZInputStream(InputStream in) throws IOException
ZInputStreamback to summary
public ZInputStream(InputStream in, boolean nowrap) throws IOException
ZInputStreamback to summary
public ZInputStream(InputStream in, int level) throws IOException

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.FilterInputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.FilterInputStream.close.

Closes this input stream and releases any system resources associated with the stream.

Exceptions
IOException:
if an I/O error occurs.
getFlushModeback to summary
public int getFlushMode()
getTotalInback to summary
public long getTotalIn()
getTotalOutback to summary
public long getTotalOut()
readback to summary
public int read() throws IOException

Overrides java.io.FilterInputStream.read.

Doc from java.io.FilterInputStream.read.

Reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.

Returns:int

the next byte of data, or -1 if the end of the stream is reached.

Exceptions
IOException:
if an I/O error occurs.
readback to summary
public int read(byte[] b, int off, int len) throws IOException

Overrides java.io.FilterInputStream.read.

Doc from java.io.FilterInputStream.read.

Reads up to len bytes of data from this input stream into an array of bytes. If len is not zero, the method blocks until some input is available; otherwise, no bytes are read and 0 is returned.

Parameters
b:byte[]

the buffer into which the data is read.

off:int

the start offset in array b at which the data is written.

len:int

the maximum number of bytes to read.

Returns:int

the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.

Exceptions
IOException:
if an I/O error occurs.
setFlushModeback to summary
public void setFlushMode(int flush)
skipback to summary
public long skip(long n) throws IOException

Overrides java.io.FilterInputStream.skip.

Doc from java.io.FilterInputStream.skip.

Skips over and discards n bytes of data from the input stream. The skip method may, for a variety of reasons, end up skipping over some smaller number of bytes, possibly 0. The actual number of bytes skipped is returned.

Parameters
n:long

the number of bytes to be skipped.

Returns:long

the actual number of bytes skipped.

Exceptions
IOException:
if in.skip(n) throws an IOException.