public abstract class

VehicleMessageStreamer

extends Object
java.lang.Object
   ↳ com.openxc.messages.streamers.VehicleMessageStreamer
Known Direct Subclasses

Class Overview

A base class for VehicleMessage streamers that defines the interface and handles counting the amount of data received.

Summary

Public Constructors
VehicleMessageStreamer()
Public Methods
abstract 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.
abstract byte[] serializeForStream(VehicleMessage message)
Serialize the message and insert any required delimiters for insertion into a message stream.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public VehicleMessageStreamer ()

Public Methods

public abstract VehicleMessage parseNextMessage ()

Deserialize and return the next messages from the internally buffered stream.

Returns
  • the next deserialized VehicleMessage.

public void receive (byte[] bytes, int length)

Add additional bytes to the buffer from the data source.

Parameters
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.

public abstract byte[] serializeForStream (VehicleMessage message)

Serialize the message and insert any required delimiters for insertion into a message stream.

Parameters
message the message to serialize.
Throws
SerializationException if the message cannot be serialized.