|
DthingApi
|
Public Member Functions | |
| DataInputStream (InputStream in) | |
| int | available () throws IOException |
| void | close () throws IOException |
| synchronized void | mark (int readlimit) |
| boolean | markSupported () |
| synchronized void | reset () throws IOException |
| final int | read (byte[] buffer) throws IOException |
| final int | read (byte[] buffer, int offset, int length) throws IOException |
| final boolean | readBoolean () throws IOException |
| final byte | readByte () throws IOException |
| final char | readChar () throws IOException |
| final double | readDouble () throws IOException |
| final float | readFloat () throws IOException |
| final void | readFully (byte[] dst) throws IOException |
| final void | readFully (byte[] dst, int offset, int byteCount) throws IOException |
| final int | readInt () throws IOException |
| final long | readLong () throws IOException |
| final short | readShort () throws IOException |
| final int | readUnsignedByte () throws IOException |
| final int | readUnsignedShort () throws IOException |
| final String | readUTF () throws IOException |
| long | skip (long n) throws IOException |
| final int | skipBytes (int count) throws IOException |
Public Member Functions inherited from java.io.FilterInputStream | |
| FilterInputStream (InputStream in) | |
| int | available () throws IOException |
| void | close () throws IOException |
| synchronized void | mark (int readlimit) |
| boolean | markSupported () |
| int | read () throws IOException |
| int | read (byte[] buffer, int offset, int count) throws IOException |
| synchronized void | reset () throws IOException |
| long | skip (long byteCount) throws IOException |
Public Member Functions inherited from java.io.InputStream | |
| InputStream () | |
| int | available () throws IOException |
| void | close () throws IOException |
| void | mark (int readlimit) |
| boolean | markSupported () |
| abstract int | read () throws IOException |
| int | read (byte[] buffer) throws IOException |
| int | read (byte[] buffer, int offset, int length) throws IOException |
| synchronized void | reset () throws IOException |
| long | skip (long byteCount) throws IOException |
Static Public Member Functions | |
| static final String | readUTF (DataInput in) throws IOException |
Additional Inherited Members | |
Protected Attributes inherited from java.io.FilterInputStream | |
| volatile InputStream | in |
Wraps an existing InputStream and reads big-endian typed data from it. Typically, this stream has been written by a DataOutputStream. Types that can be read include byte, 16-bit short, 32-bit int, 32-bit float, 64-bit long, 64-bit double, byte strings, and strings encoded in modified UTF-8.
|
inline |
Constructs a new DataInputStream on the InputStream
. All reads are then filtered through this stream. Note that data read by this stream is not in a human readable format and was most likely created by a DataOutputStream.
Warning: passing a null source creates an invalid
. All operations on such a stream will fail.
| in | the source InputStream the filter reads from. |
|
inline |
Returns the number of bytes that can be read from this input stream without blocking.
This method simply performs in.available(n) and returns the result.
| IOException | if an I/O error occurs. |
|
inline |
Closes this input stream and releases any system resources associated with the stream. This method simply performs in.close().
| IOException | if an I/O error occurs. |
|
inline |
Marks the current position in this input stream. A subsequent call to the reset method repositions this stream at the last marked position so that subsequent reads re-read the same bytes.
The readlimit argument tells this input stream to allow that many bytes to be read before the mark position gets invalidated.
This method simply performs in.mark(readlimit).
| readlimit | the maximum limit of bytes that can be read before the mark position becomes invalid. |
|
inline |
Tests if this input stream supports the mark and reset methods. This method simply performs in.markSupported().
true if this stream type supports the mark and reset method; false otherwise.
|
inline |
Reads at most
bytes from this stream and stores them in the byte array
starting at
. Returns the number of bytes that have been read or -1 if no bytes have been read and the end of the stream has been reached.
| buffer | the byte array in which to store the bytes read. |
| offset | the initial position in buffer |
| length | the maximum number of bytes to store in buffer |
| IOException | if a problem occurs while reading from this stream. |
|
inline |
Reads a boolean.
| EOFException | if the end of the input is reached before the read request can be satisfied. |
| IOException | if an I/O error occurs while reading. |
Implements java.io.DataInput.
|
inline |
Reads an 8-bit byte value.
| EOFException | if the end of the input is reached before the read request can be satisfied. |
| IOException | if an I/O error occurs while reading. |
Implements java.io.DataInput.
|
inline |
Reads a big-endian 16-bit character value.
| EOFException | if the end of the input is reached before the read request can be satisfied. |
| IOException | if an I/O error occurs while reading. |
Implements java.io.DataInput.
|
inline |
Reads a big-endian 64-bit double value.
| EOFException | if the end of the input is reached before the read request can be satisfied. |
| IOException | if an I/O error occurs while reading. |
Implements java.io.DataInput.
|
inline |
Reads a big-endian 32-bit float value.
| EOFException | if the end of the input is reached before the read request can be satisfied. |
| IOException | if an I/O error occurs while reading. |
Implements java.io.DataInput.
|
inline |
|
inline |
Reads
bytes from this stream and stores them in the byte array
starting at
. If
is zero, then this method returns without reading any bytes. Otherwise, this method blocks until
bytes have been read. If insufficient bytes are available,
is thrown. If an I/O error occurs,
is thrown. When an exception is thrown, some bytes may have been consumed from the stream and written into the array.
| dst | the byte array into which the data is read. |
| offset | the offset in dst |
| byteCount | the number of bytes to read. |
| EOFException | if the end of the source stream is reached before enough bytes have been read. |
| IndexOutOfBoundsException | if offset < 0 byteCount < 0 offset + byteCount > dst.length |
| IOException | if a problem occurs while reading from this stream. |
| NullPointerException | if dst |
Implements java.io.DataInput.
|
inline |
Reads a big-endian 32-bit integer value.
| EOFException | if the end of the input is reached before the read request can be satisfied. |
| IOException | if an I/O error occurs while reading. |
Implements java.io.DataInput.
|
inline |
Reads a big-endian 64-bit long value.
| EOFException | if the end of the input is reached before the read request can be satisfied. |
| IOException | if an I/O error occurs while reading. |
Implements java.io.DataInput.
|
inline |
Reads a big-endian 16-bit short value.
| EOFException | if the end of the input is reached before the read request can be satisfied. |
| IOException | if an I/O error occurs while reading. |
Implements java.io.DataInput.
|
inline |
Reads an unsigned 8-bit byte value and returns it as an int.
| EOFException | if the end of the input is reached before the read request can be satisfied. |
| IOException | if an I/O error occurs while reading. |
Implements java.io.DataInput.
|
inline |
Reads a big-endian 16-bit unsigned short value and returns it as an int.
| EOFException | if the end of the input is reached before the read request can be satisfied. |
| IOException | if an I/O error occurs while reading. |
Implements java.io.DataInput.
|
inline |
Reads a string encoded with modified UTF-8.
| EOFException | if the end of the input is reached before the read request can be satisfied. |
| IOException | if an I/O error occurs while reading. |
Implements java.io.DataInput.
|
inline |
Repositions this stream to the position at the time the mark method was last called on this input stream.
This method simply performs in.reset().
Stream marks are intended to be used in situations where you need to read ahead a little to see what's in the stream. Often this is most easily done by invoking some general parser. If the stream is of the type handled by the parse, it just chugs along happily. If the stream is not of that type, the parser should toss an exception when it fails. If this happens within readlimit bytes, it allows the outer code to reset the stream and try another parser.
| IOException | if the stream has not been marked or if the mark has been invalidated. |
|
inline |
Skips over and discards n bytes of data from the input stream. The skip method may, for a variety of reasons, end up skipping over some smaller number of bytes, possibly 0. The actual number of bytes skipped is returned.
This method simply performs in.skip(n).
| n | the number of bytes to be skipped. |
| IOException | if an I/O error occurs. |
|
inline |
Skips
number of bytes in this stream. Subsequent
s will not return these bytes unless
is used.
This method will not throw an EOFException if the end of the input is reached before
bytes where skipped.
| count | the number of bytes to skip. |
| IOException | if a problem occurs during skipping. |
Implements java.io.DataInput.
1.8.13