public static interface BinaryMessage.Builder
| Modifier and Type | Method and Description |
|---|---|
BinaryMessage |
build()
Returns a new
BinaryMessage based on the data provided by this Builder. |
BinaryMessage.Builder |
writeBits(int value,
int numberOfBits)
Writes
value as numberOfBits bits. |
BinaryMessage.Builder |
writeByte(int value)
Writes
value as a byte. |
BinaryMessage.Builder |
writeInt(int value)
Writes
value as an int. |
BinaryMessage.Builder |
writeLong(long value)
Writes
value as a long. |
BinaryMessage.Builder |
writeShort(int value)
Writes
value as a short. |
BinaryMessage build()
BinaryMessage based on the data provided by this Builder.BinaryMessage based on the data provided by this BuilderBinaryMessage.Builder writeBits(int value, int numberOfBits)
value as numberOfBits bits.
Returns the Builder instance itself.
value - the value to write as numberOfBits bitsnumberOfBits - the number of bits to write value withBuilder itselfBinaryMessage.Builder writeByte(int value)
value as a byte.
The current write offset is increased by 1.
Returns the Builder instance itself.
value - the value to write as a byteBuilder itselfBinaryMessage.Builder writeInt(int value)
value as an int.
The current write offset is increased by 4.
Returns the Builder instance itself.
value - the value to write as an intBuilder itselfBinaryMessage.Builder writeLong(long value)
value as a long.
The current write offset is increased by 8.
Returns the Builder instance itself.
value - the value to write as a longBuilder itselfBinaryMessage.Builder writeShort(int value)
value as a short.
The current write offset is increased by 2.
Returns the Builder instance itself.
value - the value to write as a shortBuilder itself