public class BinaryFormatter
extends java.lang.Object
Constructor and Description |
---|
BinaryFormatter() |
Modifier and Type | Method and Description |
---|---|
static VehicleMessage |
deserialize(java.io.InputStream data)
Deserialize a single vehicle message from the input stream.
|
static MessageLite |
preSerialize(VehicleMessage message)
Serialize a VehicleMessage into an intermediate protobuf object.
|
static byte[] |
serialize(VehicleMessage message)
Serialize a VehicleMessage into a byte array.
|
public static VehicleMessage deserialize(java.io.InputStream data) throws UnrecognizedMessageTypeException
data
- The stream that should include protobuf-encoded vehicle
messages.UnrecognizedMessageTypeException
- if a message could not be
deserialized.public static byte[] serialize(VehicleMessage message) throws SerializationException
message
- the VehicleMessage to serialize.SerializationException
- if there was an error with serializing the
message.public static MessageLite preSerialize(VehicleMessage message) throws SerializationException
SerializationException