public class BinaryStreamer extends VehicleMessageStreamer
Constructor and Description |
---|
BinaryStreamer() |
Modifier and Type | Method and Description |
---|---|
static void |
dumpToLog(byte[] bytes,
int length) |
java.lang.String |
getRawMessage() |
VehicleMessage |
parseMessage(java.lang.String line) |
VehicleMessage |
parseNextMessage()
Deserialize and return the next messages from the internally buffered
stream.
|
void |
receive(byte[] bytes,
int length)
Add additional bytes to the buffer from the data source.
|
byte[] |
serializeForStream(VehicleMessage message)
Serialize the message and insert any required delimiters for insertion
into a message stream.
|
public VehicleMessage parseNextMessage()
VehicleMessageStreamer
parseNextMessage
in class VehicleMessageStreamer
public VehicleMessage parseMessage(java.lang.String line)
parseMessage
in class VehicleMessageStreamer
public java.lang.String getRawMessage()
getRawMessage
in class VehicleMessageStreamer
public byte[] serializeForStream(VehicleMessage message) throws SerializationException
VehicleMessageStreamer
serializeForStream
in class VehicleMessageStreamer
message
- the message to serialize.SerializationException
- if the message cannot be serialized.public static void dumpToLog(byte[] bytes, int length)
public void receive(byte[] bytes, int length)
VehicleMessageStreamer
receive
in class VehicleMessageStreamer
bytes
- an array of bytes received from the interface.length
- number of bytes received, and thus the amount that should
be read from the array.