| java.lang.Object | |
| ↳ | java.io.InputStream |
Known Direct Subclasses
|
Known Indirect Subclasses
|
InputStream is an abstract class for all byte input streams. It provides basic method implementations for reading bytes from a stream.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
This constructor does nothing interesting.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Returns a int representing then number of bytes that are available before
this InputStream will block.
| |||||||||||
Close the InputStream.
| |||||||||||
Set a Mark position in this InputStream.
| |||||||||||
Returns a boolean indicating whether or not this InputStream supports
mark() and reset().
| |||||||||||
Reads at most
length bytes from the Stream and stores them
in byte array b starting at offset. | |||||||||||
Reads bytes from the Stream and stores them in byte array
b. | |||||||||||
Reads a single byte from this InputStream and returns the result as an
int.
| |||||||||||
Reset this InputStream to the last marked location.
| |||||||||||
Skips
n number of bytes in this InputStream. | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class java.lang.Object
| |||||||||||
From interface java.io.Closeable
| |||||||||||
This constructor does nothing interesting. Provided for signature compatibility.
Returns a int representing then number of bytes that are available before this InputStream will block. This method always returns 0. Subclasses should override and indicate the correct number of bytes available.
| IOException | If an error occurs in this InputStream. |
|---|
Close the InputStream. Concrete implementations of this class should free any resources during close. This implementation does nothing.
| IOException | If an error occurs attempting to close this InputStream. |
|---|
Set a Mark position in this InputStream. The parameter
readLimit indicates how many bytes can be read before a
mark is invalidated. Sending reset() will reposition the Stream back to
the marked position provided readLimit has not been
surpassed.
This default implementation does nothing and concrete subclasses must provide their own implementations.
| readlimit | the number of bytes to be able to read before invalidating the mark. |
|---|
Returns a boolean indicating whether or not this InputStream supports mark() and reset(). This class provides a default implementation which returns false.
true if mark() and reset() are supported,
false otherwise.
Reads at most length bytes from the Stream and stores them
in byte array b starting at offset. Answer
the number of bytes actually read or -1 if no bytes were read and end of
stream was encountered.
| b | the byte array in which to store the read bytes. |
|---|---|
| offset | the offset in b to store the read bytes. |
| length | the maximum number of bytes to store in b. |
| IOException | If the stream is already closed or another IOException occurs. |
|---|
Reads bytes from the Stream and stores them in byte array b.
Answer the number of bytes actually read or -1 if no bytes were read and
end of stream was encountered.
| b | the byte array in which to store the read bytes. |
|---|
| IOException | If the stream is already closed or another IOException occurs. |
|---|
Reads a single byte from this InputStream and returns the result as an int. The low-order byte is returned or -1 of the end of stream was encountered. This abstract implementation must be provided by concrete subclasses.
| IOException | If the stream is already closed or another IOException occurs. |
|---|
Reset this InputStream to the last marked location. If the
readlimit has been passed or no mark has
been set, throw IOException. This implementation throws IOException and
concrete subclasses should provide proper implementations.
| IOException | If the stream is already closed or another IOException occurs. |
|---|
Skips n number of bytes in this InputStream. Subsequent
read()'s will not return these bytes unless
reset() is used. This method may perform multiple reads to
read n bytes. This default implementation reads
n bytes into a temporary buffer. Concrete subclasses
should provide their own implementation.
| n | the number of bytes to skip. |
|---|
| IOException | If the stream is already closed or another IOException occurs. |
|---|