ZigBeeDataOutput interface is designed for converting Java data
types into a series of bytes. The purpose of this interface is the same as
the DataOutput interface provided by Java, with the difference that in this
interface, the generated bytes ordering is little endian, whereas in the
DataOutput is big endian.
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | writeBytes(byte[]
A buffer containing the bytes to append to the data output
stream. bytes, int The length in bytes that have to be actually appended. length)Appends on the Data Output Stream a byte array. |
| public void | writeDouble(double
The value)double value to append.Appends on the Data Output Stream a |
| public void | writeFloat(float
The value, int float value to append.The size in bytes that have to be actually appended. The size
must be 2 for semi precision floats or 4 for standard precision
floats (see the ZigBee Cluster Library specifications). size)Appends on the Data Output Stream a float value. |
| public void | writeInt(int
The integer value to append value, int The size in bytes that have to be actually appended. The size
must be in the range [1,4]. size)Appends an int value to the data output. |
| public void | writeLong(long
The value, int long value to appendThe size in bytes that have to be actually appended. The size
must be in the range [1,8]. size)Appends a long to the data output. |
| writeByte | back to summary |
|---|---|
| public void writeByte(byte value) Appends a byte to the data output. To avoid losing information, the passed value must be in the range [-128, 127] for signed numbers and [0, 255] for unsigned numbers.
| |
| writeBytes | back to summary |
|---|---|
| public void writeBytes(byte[] bytes, int length) throws IOException Appends on the Data Output Stream a byte array. The byte array is written on the data output starting from the byte at index 0.
| |
| writeDouble | back to summary |
|---|---|
| public void writeDouble(double value) throws IOException Appends on the Data Output Stream a
| |
| writeFloat | back to summary |
|---|---|
| public void writeFloat(float value, int size) throws IOException Appends on the Data Output Stream a float value.
| |
| writeInt | back to summary |
|---|---|
| public void writeInt(int value, int size) throws IOException Appends an int value to the data output.
To avoid losing information, according to the
For unsigned numbers it should fit in the range [ 0, -2^(
For instance if
Although this method allows write even 1 byte of the passed
| |
| writeLong | back to summary |
|---|---|
| public void writeLong(long value, int size) throws IOException Appends a long to the data output.
To avoid losing information, according to the
For unsigned numbers it should fit in the range [ 0, -2^(
For instance if
Although this method allows write even 1 byte of the passed
| |