org.apache.webdav.lib
Class ResponseInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--org.apache.webdav.lib.ResponseInputStream

public class ResponseInputStream
extends java.io.InputStream

Socket input stream wrapper.

Version:
$Revision: 1.3 $ $Date: 2001/03/01 22:00:59 $
Author:
Remy Maucherat

Field Summary
protected  boolean chunk
          Use chunking ?
protected  byte[] chunkBuffer
          Chunk buffer.
protected  int chunkLength
          Chunk length.
protected  int chunkPos
          Chunk buffer position.
protected  boolean closed
          Has this stream been closed?
protected  int count
          The number of bytes which have already been returned by this stream.
protected  boolean endChunk
          True if the final chunk was found.
protected  int length
          The content length past which we will not read, or -1 if there is no defined content length.
protected  java.io.InputStream stream
          The underlying input stream from which we should read data.
 
Constructor Summary
ResponseInputStream(java.io.InputStream stream, java.util.Hashtable responseHeaders)
          Construct a servlet input stream associated with the specified Request.
 
Method Summary
 void close()
          Close this input stream.
 int read()
          Read and return a single byte from this input stream, or -1 if end of file has been encountered.
 
Methods inherited from class java.io.InputStream
available, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

closed

protected boolean closed
Has this stream been closed?

chunk

protected boolean chunk
Use chunking ?

endChunk

protected boolean endChunk
True if the final chunk was found.

chunkBuffer

protected byte[] chunkBuffer
Chunk buffer.

chunkLength

protected int chunkLength
Chunk length.

chunkPos

protected int chunkPos
Chunk buffer position.

count

protected int count
The number of bytes which have already been returned by this stream.

length

protected int length
The content length past which we will not read, or -1 if there is no defined content length.

stream

protected java.io.InputStream stream
The underlying input stream from which we should read data.
Constructor Detail

ResponseInputStream

public ResponseInputStream(java.io.InputStream stream,
                           java.util.Hashtable responseHeaders)
Construct a servlet input stream associated with the specified Request.
Parameters:
request - The associated request
Method Detail

close

public void close()
           throws java.io.IOException
Close this input stream. No physical level I-O is performed, but any further attempt to read from this stream will throw an IOException. If a content length has been set but not all of the bytes have yet been consumed, the remaining bytes will be swallowed.
Overrides:
close in class java.io.InputStream

read

public int read()
         throws java.io.IOException
Read and return a single byte from this input stream, or -1 if end of file has been encountered.
Overrides:
read in class java.io.InputStream
Throws:
java.io.IOException - if an input/output error occurs