public interface DataInputStream
extends java.io.Closeable
The data input stream provides a means for reading data from a stream.
Modifier and Type | Method and Description |
---|---|
boolean |
atEndOfStream()
Tests if the end of this stream has been reached.
|
long |
available()
Gets the number of
bytes available for retrieval. |
void |
close()
Closes this stream and frees up any allocated resources.
|
long |
read(byte[] buf,
long n)
Reads a specified number of
bytes from this stream. |
long |
skip(long n)
Skips a specified number of
bytes in the stream. |
boolean atEndOfStream()
true
if the end of this stream has been
reached, false
otherwiseIllegalStateException
- this stream has been closedmandatory
- This method must be implemented. long available()
bytes
available for retrieval. The
number returned by this method may be less than or equal to the total
number of bytes
in this stream. bytes
available for retrievalIllegalStateException
- this stream has been closedmandatory
- This method must be implemented. long skip(long n)
bytes
in the stream.n
- the number of bytes
to skip bytes
skippedIllegalStateException
- this stream has been closed or
atEndOfStream()
is true
mandatory
- This method must be implemented. long read(byte[] buf, long n) throws OperationFailedException
bytes
from this stream.buf
- the buffer in which the data is readn
- the number of bytes
to read bytes
readIllegalStateException
- this stream has been closed or
atEndOfStream()
is true
InvalidArgumentException
- the size of buf
is less than n
NullArgumentException
- buf
is
null
OperationFailedException
- unable to complete requestmandatory
- This method must be implemented. void close()
close
in interface java.lang.AutoCloseable
close
in interface java.io.Closeable
IllegalStateException
- this stream has been closedmandatory
- This method must be implemented.