net.vattp.tunnel
Class HTTPInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--net.vattp.tunnel.HTTPInputStream

public class HTTPInputStream
extends InputStream

Untamed: Class to handle the suspension and shutdown messages.

Author:
Bill Frantz

Field Summary
private  long myLengthLimit
           
private  InputStream myStream
           
 
Fields inherited from class java.io.InputStream
 
Constructor Summary
(package private) HTTPInputStream(InputStream stream)
           
 
Method Summary
 int available()
          Enabled: Returns the number of bytes that can be read from this input stream without blocking.
 void close()
          Enabled: Closes this input stream and releases any system resources associated with the stream.
 int read()
          Enabled: Reads the next byte of data from this input stream.
 int read(byte[] b, int off, int len)
          Enabled: Reads up to len bytes of data from this input stream into an array of bytes.
 void setSize(long size)
          Enabled: Set the stream size.
 
Methods inherited from class java.io.InputStream
__printOn, getCryptoHash, mark, markSupported, read, readAvailable, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myStream

private final InputStream myStream

myLengthLimit

private long myLengthLimit
Constructor Detail

HTTPInputStream

HTTPInputStream(InputStream stream)
Method Detail

available

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

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

close

public void close()
           throws IOException
Enabled: Closes this input stream and releases any system resources associated with the stream.

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

read

public int read()
         throws IOException
Enabled: Reads the next byte of data from this 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.

A subclass must provide an implementation of this method.

Specified by:
read in class InputStream
Returns:
the next byte of data, or -1 if the end of the stream is reached.
Throws:
IOException - if an I/O error occurs.
Since:
JDK1.0

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Enabled: Reads up to len bytes of data from this input stream into an array of bytes. This method blocks until some input is available. If the first argument is null, up to len bytes are read and discarded.

Overrides:
read in class InputStream
Parameters:
b - the buffer into which the data is read.
off - the start offset of the data.
len - the maximum number of bytes read.
Returns:
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.
Throws:
IOException - if an I/O error occurs.
See Also:
java.io.InputStream#read()

setSize

public void setSize(long size)
Enabled: Set the stream size.



comments?