com.ibm.net.ssl.internal.www.protocol.https
Class ChunkedInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--com.ibm.net.ssl.internal.www.protocol.https.ChunkedInputStream

public class ChunkedInputStream
extends java.io.InputStream

Read Transfer-Encoding chunks.

Version:
1.2 06/13/99
Author:
Jeff Nisewanger

Constructor Summary
ChunkedInputStream(java.io.InputStream in)
          Creates a BufferedInputStream and saves its argument, the input stream in, for later use.
 
Method Summary
 int available()
          Returns the number of bytes that can be read from this input stream without blocking.
 void close()
          Closes this input stream and releases any system resources associated with the stream.
 void print()
           
 int read()
          See the general contract of the read method of InputStream.
 int read(byte[] b, int off, int len)
          Reads bytes from this byte-input stream into the specified byte array, starting at the given offset.
 
Methods inherited from class java.io.InputStream
mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChunkedInputStream

public ChunkedInputStream(java.io.InputStream in)
                   throws java.io.IOException
Creates a BufferedInputStream and saves its argument, the input stream in, for later use. An internal buffer array is created and stored in buf.
Parameters:
in - the underlying input stream.
Method Detail

print

public void print()

read

public int read()
         throws java.io.IOException
See the general contract of the read method of InputStream.
Overrides:
read in class java.io.InputStream
Returns:
the next byte of data, or -1 if the end of the stream is reached.
Throws:
java.io.IOException - if an I/O error occurs.
See Also:
java.io.FilterInputStream#in

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Reads bytes from this byte-input stream into the specified byte array, starting at the given offset.

This method implements the general contract of the corresponding read method of the InputStream class. As an additional convenience, it attempts to read as many bytes as possible by repeatedly invoking the read method of the underlying stream. This iterated read continues until one of the following conditions becomes true:

If the first read on the underlying stream returns -1 to indicate end-of-file then this method returns -1. Otherwise this method returns the number of bytes actually read.

Subclasses of this class are encouraged, but not required, to attempt to read as many bytes as possible in the same fashion.

Overrides:
read in class java.io.InputStream
Parameters:
b - destination buffer.
off - offset at which to start storing bytes.
len - maximum number of bytes to read.
Returns:
the number of bytes read, or -1 if the end of the stream has been reached.
Throws:
java.io.IOException - if an I/O error occurs.

available

public int available()
              throws java.io.IOException
Returns the number of bytes that can be read from this input stream without blocking.

The available method of BufferedInputStream returns the sum of the the number of bytes remaining to be read in the buffer (count - pos) and the result of calling the available method of the underlying input stream.

Overrides:
available in class java.io.InputStream
Returns:
the number of bytes that can be read from this input stream without blocking.
Throws:
java.io.IOException - if an I/O error occurs.
See Also:
java.io.FilterInputStream#in

close

public void close()
           throws java.io.IOException
Closes this input stream and releases any system resources associated with the stream.
Overrides:
close in class java.io.InputStream
Throws:
java.io.IOException - if an I/O error occurs.