org.apache.axis.transport.http
Class NonBlockingBufferedInputStream
InputStream
org.apache.axis.transport.http.NonBlockingBufferedInputStream
public class NonBlockingBufferedInputStream
extends InputStream
int | available() - return the number of bytes available to be read without blocking
|
void | close() - disassociate from the underlying input stream
|
int | peek() - Just like read except byte is not removed from the buffer.
|
int | read() - Read a byte from the input stream, blocking if necessary.
|
int | read(byte[] dest) - Read bytes from the input stream.
|
int | read(byte[] dest, int off, int len) - Read a specified number of bytes from the input stream.
|
void | setContentLength(int value) - set the maximum number of bytes allowed to be read from this input
stream.
|
void | setInputStream(InputStream in) - set the input stream to be used for subsequent reads
|
int | skip(int len) - skip over (and discard) a specified number of bytes in this input
stream
|
available
public int available()
throws IOException
return the number of bytes available to be read without blocking
close
public void close()
throws IOException
disassociate from the underlying input stream
peek
public int peek()
throws IOException
Just like read except byte is not removed from the buffer.
the data is buffered for efficiency.
Was added to support multiline http headers. ;-)
read
public int read()
throws IOException
Read a byte from the input stream, blocking if necessary. Internally
the data is buffered for efficiency.
read
public int read(byte[] dest)
throws IOException
Read bytes from the input stream. This is guaranteed to return at
least one byte or throw an exception. When possible, it will return
more bytes, up to the length of the array, as long as doing so would
not require waiting on bytes from the input stream.
dest
- byte array to read into
- the number of bytes actually read
read
public int read(byte[] dest,
int off,
int len)
throws IOException
Read a specified number of bytes from the input stream. This is
guaranteed to return at least one byte or throw an execption. When
possible, it will return more bytes, up to the length specified,
as long as doing so would not require waiting on bytes from the
input stream.
dest
- byte array to read intooff
- starting offset into the byte arraylen
- maximum number of bytes to read
- the number of bytes actually read
setContentLength
public void setContentLength(int value)
set the maximum number of bytes allowed to be read from this input
stream.
value
- the Content Length
setInputStream
public void setInputStream(InputStream in)
set the input stream to be used for subsequent reads
skip
public int skip(int len)
throws IOException
skip over (and discard) a specified number of bytes in this input
stream
len
- the number of bytes to be skipped
- the action number of bytes skipped
Copyright B) 2005 Apache Web Services Project. All Rights Reserved.