This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


java.util.zip
class DeflaterInputStream

java.lang.Object extended by java.io.InputStream extended by java.io.FilterInputStream extended by java.util.zip.DeflaterInputStream
All Implemented Interfaces:
Closeable

public class DeflaterInputStream
extends FilterInputStream

Implements an input stream filter for compressing data in the "deflate" compression format.


Field Summary
protected byte[] buf
          Input buffer for reading compressed data.
protected Deflater def
          Compressor for this stream.
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary

          Creates a new input stream with a default compressor and buffer size.

          Creates a new input stream with the specified compressor and a default buffer size.
DeflaterInputStream(InputStream in, Deflater defl, int bufLen)

          Creates a new input stream with the specified compressor and buffer size.
 
Method Summary
 int

          Returns 0 after EOF has been reached, otherwise always return 1.
 void

          Closes this input stream and its underlying input stream, discarding any pending uncompressed data.
 void
mark(int limit)

          This operation is not supported.
 boolean

          Always returns because this input stream does not support the java.util.zip.DeflaterInputStream.mark and java.util.zip.DeflaterInputStream.reset methods.
 int

          Reads a single byte of compressed data from the input stream.
 int
read(byte[] b, int off, int len)

          Reads compressed data into a byte array.
 void

          This operation is not supported.
 long
skip(long n)

          Skips over and discards data from the input stream.
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, read, read, read, reset, skip
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buf

protected final byte[] buf
Input buffer for reading compressed data.

def

protected final Deflater def
Compressor for this stream.
Constructor Detail

DeflaterInputStream

public DeflaterInputStream(InputStream in)
Creates a new input stream with a default compressor and buffer size.

Parameters:
in - input stream to read the uncompressed data to

DeflaterInputStream

public DeflaterInputStream(InputStream in,
                           Deflater defl)
Creates a new input stream with the specified compressor and a default buffer size.

Parameters:
in - input stream to read the uncompressed data to
defl - compressor ("deflater") for this stream

DeflaterInputStream

public DeflaterInputStream(InputStream in,
                           Deflater defl,
                           int bufLen)
Creates a new input stream with the specified compressor and buffer size.

Parameters:
in - input stream to read the uncompressed data to
defl - compressor ("deflater") for this stream
bufLen - compression buffer size
Method Detail

available

public int available()
              throws IOException
Returns 0 after EOF has been reached, otherwise always return 1.

Programs should not count on this method to return the actual number of bytes that could be read without blocking

Overrides:
available in class FilterInputStream
Returns:
zero after the end of the underlying input stream has been reached, otherwise always returns 1
Throws:
IOException - if an I/O error occurs or if this stream is already closed

close

public void close()
           throws IOException
Closes this input stream and its underlying input stream, discarding any pending uncompressed data.

Overrides:
close in class FilterInputStream
Throws:
IOException - if an I/O error occurs

mark

public void mark(int limit)
This operation is not supported.

Overrides:
mark in class FilterInputStream
Parameters:
limit - maximum bytes that can be read before invalidating the position marker

markSupported

public boolean markSupported()
Always returns {@code false} because this input stream does not support the {@link #mark mark()} and {@link #reset reset()} methods.

Overrides:
markSupported in class FilterInputStream
Returns:
false, always

read

public int read()
         throws IOException
Reads a single byte of compressed data from the input stream. This method will block until some input can be read and compressed.

Overrides:
read in class FilterInputStream
Returns:
a single byte of compressed data, or -1 if the end of the uncompressed input stream is reached
Throws:
IOException - if an I/O error occurs or if this stream is already closed

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Reads compressed data into a byte array. This method will block until some input can be read and compressed.

Overrides:
read in class FilterInputStream
Parameters:
b - buffer into which the data is read
off - starting offset of the data within {@code b}
len - maximum number of compressed bytes to read into {@code b}
Returns:
the actual number of bytes read, or -1 if the end of the uncompressed input stream is reached
Throws:
IOException - if an I/O error occurs or if this input stream is already closed

reset

public void reset()
           throws IOException
This operation is not supported.

Overrides:
reset in class FilterInputStream
Throws:
IOException - always thrown

skip

public long skip(long n)
          throws IOException
Skips over and discards data from the input stream. This method may block until the specified number of bytes are read and skipped. Note: While {@code n} is given as a {@code long}, the maximum number of bytes which can be skipped is {@code Integer.MAX_VALUE}.

Overrides:
skip in class FilterInputStream
Parameters:
n - number of bytes to be skipped
Returns:
the actual number of bytes skipped
Throws:
IOException - if an I/O error occurs or if this stream is already closed


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.