org.apache.axis.transport.http
Class NonBlockingBufferedInputStream
java.lang.Object
|
+--java.io.InputStream
|
+--org.apache.axis.transport.http.NonBlockingBufferedInputStream
- public class NonBlockingBufferedInputStream
- extends java.io.InputStream
Method Summary |
int |
available()
return the number of bytes available to be read without blocking |
void |
close()
disassociate from the underlying input stream |
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(java.io.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 |
Methods inherited from class java.io.InputStream |
mark, markSupported, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NonBlockingBufferedInputStream
public NonBlockingBufferedInputStream()
setInputStream
public void setInputStream(java.io.InputStream in)
- set the input stream to be used for subsequent reads
- Parameters:
in
- the InputStream
setContentLength
public void setContentLength(int value)
- set the maximum number of bytes allowed to be read from this input
stream.
- Parameters:
value
- the Content Length
read
public int read()
throws java.io.IOException
- Read a byte from the input stream, blocking if necessary. Internally
the data is buffered for efficiency.
- Overrides:
read
in class java.io.InputStream
- Returns:
- the byte read
read
public int read(byte[] dest)
throws java.io.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.
- Overrides:
read
in class java.io.InputStream
- Parameters:
dest
- byte array to read into- Returns:
- the number of bytes actually read
read
public int read(byte[] dest,
int off,
int len)
throws java.io.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.
- Overrides:
read
in class java.io.InputStream
- Parameters:
dest
- byte array to read intooff
- starting offset into the byte arraylen
- maximum number of bytes to read- Returns:
- the number of bytes actually read
skip
public int skip(int len)
throws java.io.IOException
- skip over (and discard) a specified number of bytes in this input
stream
- Parameters:
len
- the number of bytes to be skipped- Returns:
- the action number of bytes skipped
available
public int available()
throws java.io.IOException
- return the number of bytes available to be read without blocking
- Overrides:
available
in class java.io.InputStream
- Returns:
- the number of bytes
close
public void close()
throws java.io.IOException
- disassociate from the underlying input stream
- Overrides:
close
in class java.io.InputStream
Copyright © 2001 Apache XML Project. All Rights Reserved.