ZigBeeDataInput interface is designed for converting a series of
bytes in Java data types. The purpose of this interface is the same as the
DataInput interface available in the standard Java library, with the
difference that in this interface, byte ordering is little endian, whereas in
the DataInput interface is big endian.
Each method provided by this interface read one or more bytes from the
underlying stream, combine them, and return a Java data type. The pointer to
the stream is then moved immediately after the last byte read. If this
pointer past the available buffer bounds, a subsequent call to one of these
methods will throw a EOFException.
| Modifier and Type | Method and Description |
|---|---|
| public byte | |
| public byte[] | Returns: return a copy of the bytes contained in the stream.the number of bytes to read. len)Reads the specified amount of bytes from the underlying stream and return a copy of them. |
| public double | |
| public float | Returns: Thefloat number read from the data input.expected value for this parameter are 2 or 4 depending if
reading size)ZigBeeDataTypes#FLOATING_SEMI or
ZigBeeDataTypes#FLOATING_SINGLE.Reads a number of type Float. |
| public int | Returns: the integer read from the data input.the number of bytes that have to be read. Allowed values for
this parameter are in the range [1, 4]. size)Reads an integer of the specified |
| public long | Returns: Thelong value read from the data input.the number of bytes that have to be read. Allowed values for
this parameter are in the range [1, 8]. size)Reads a certain amount of bytes and returns a long. |
| readByte | back to summary |
|---|---|
| public byte readByte() throws IOException Reads a byte from the DataInput Stream.
| |
| readBytes | back to summary |
|---|---|
| public byte[] readBytes(int len) throws IOException Reads the specified amount of bytes from the underlying stream and return a copy of them. If the number of available bytes is less than the requested len, it throws an EOFException.
| |
| readDouble | back to summary |
|---|---|
| public double readDouble() throws IOException Reads a number of type Double.
| |
| readFloat | back to summary |
|---|---|
| public float readFloat(int size) throws IOException Reads a number of type Float.
| |
| readInt | back to summary |
|---|---|
| public int readInt(int size) throws IOException Reads an integer of the specified
| |
| readLong | back to summary |
|---|---|
| public long readLong(int size) throws IOException Reads a certain amount of bytes and returns a long. The sign bit of the
read
| |