public final class DatagramWriter extends Object
| Constructor and Description |
|---|
DatagramWriter()
Creates a new empty writer.
|
| Modifier and Type | Method and Description |
|---|---|
int |
size() |
byte[] |
toByteArray()
Returns a byte array containing the sequence of bits written.
|
String |
toString() |
void |
write(DatagramWriter data) |
void |
write(int data,
int numBits)
Writes a sequence of bits to the stream.
|
void |
writeByte(byte b)
Writes one byte to the stream.
|
void |
writeBytes(byte[] bytes)
Writes a sequence of bytes to the stream.
|
void |
writeCurrentByte()
Writes pending bits to the stream.
|
void |
writeLong(long data,
int numBits)
Writes a sequence of bits to the stream.
|
public void writeLong(long data,
int numBits)
data - A Long containing the bits to write.numBits - The number of bits to write.public void write(int data,
int numBits)
data - An integer containing the bits to write.numBits - The number of bits to write.public void writeBytes(byte[] bytes)
bytes - The sequence of bytes to write.public void writeByte(byte b)
b - The byte to be written.public byte[] toByteArray()
public void write(DatagramWriter data)
public int size()
public void writeCurrentByte()
Copyright © 2019 Eclipse Foundation. All rights reserved.