public interface MessageWriter extends Closeable, Flushable
| Modifier and Type | Method and Description |
|---|---|
MessageFormatType |
getFormatType()
Returns the type of the underlying serialization protocol.
|
void |
writeBinary(int tag,
String name,
Binary binary) |
default void |
writeBinary(int tag,
String name,
byte[] bytes) |
default void |
writeBinary(int tag,
String name,
byte[] bytes,
int offset,
int length) |
default void |
writeBinary(int tag,
String name,
ByteBuffer buffer) |
void |
writeBoolean(int tag,
String name,
Boolean value)
Writes a boolean.
|
void |
writeDecimal(int tag,
String name,
BigDecimal value) |
void |
writeDouble(int tag,
String name,
Double value)
Writes a double.
|
void |
writeEnum(int tag,
String name,
MessageEnum serializable) |
void |
writeFloat(int tag,
String name,
Float value)
Writes a float.
|
void |
writeInt(int tag,
String name,
Integer value)
Writes an integer.
|
void |
writeInt64(int tag,
String name,
Long value)
Writes a long.
|
<T> void |
writeList(int tag,
String name,
List<T> list,
ValueSerializer<T> serializer)
Writes a list.
|
<K,V> void |
writeMap(int tag,
String name,
Map<K,V> map,
ValueSerializer<K> keySerializer,
ValueSerializer<V> valueSerializer)
Writes a map.
|
<T extends Message> |
writeMessage(int tag,
String name,
T message,
MessageSerializer<T> serializer)
Writes the specified message if it is non-null.
|
void |
writePosition(int tag,
String name,
Position value) |
void |
writePositionTime(int tag,
String name,
PositionTime value) |
<T> void |
writeSet(int tag,
String name,
Set<T> set,
ValueSerializer<T> serializer)
Writes a set.
|
void |
writeText(int tag,
String name,
String value)
Writes a string.
|
void |
writeTimestamp(int tag,
String name,
Timestamp value) |
void |
writeVarInt(int tag,
String name,
BigInteger value) |
MessageFormatType getFormatType()
default void writeBinary(int tag,
String name,
byte[] bytes)
throws IOException
IOExceptiondefault void writeBinary(int tag,
String name,
byte[] bytes,
int offset,
int length)
throws IOException
IOExceptiondefault void writeBinary(int tag,
String name,
ByteBuffer buffer)
throws IOException
IOExceptionvoid writeBinary(int tag,
String name,
Binary binary)
throws IOException
IOExceptionvoid writeBoolean(int tag,
String name,
Boolean value)
throws IOException
tag - the tag valuename - the tag namevalue - the boolean value to writeIOException - If an I/O error occursvoid writeDouble(int tag,
String name,
Double value)
throws IOException
tag - the tag valuename - the tag namevalue - the double value to writeIOException - If an I/O error occursvoid writeEnum(int tag,
String name,
MessageEnum serializable)
throws IOException
IOExceptionvoid writeFloat(int tag,
String name,
Float value)
throws IOException
tag - the tag valuename - the tag namevalue - the float value to writeIOException - If an I/O error occursvoid writeInt(int tag,
String name,
Integer value)
throws IOException
tag - the tag valuename - the tag namevalue - the integer value to writeIOException - If an I/O error occursvoid writeVarInt(int tag,
String name,
BigInteger value)
throws IOException
IOExceptionvoid writeDecimal(int tag,
String name,
BigDecimal value)
throws IOException
IOExceptionvoid writePosition(int tag,
String name,
Position value)
throws IOException
IOExceptionvoid writePositionTime(int tag,
String name,
PositionTime value)
throws IOException
IOExceptionvoid writeTimestamp(int tag,
String name,
Timestamp value)
throws IOException
IOExceptionvoid writeInt64(int tag,
String name,
Long value)
throws IOException
tag - the tag valuename - the tag namevalue - the long value to writeIOException - If an I/O error occurs<T> void writeList(int tag,
String name,
List<T> list,
ValueSerializer<T> serializer)
throws IOException
T - the type of elementstag - the tag valuename - the tag namelist - the list to writeserializer - the serializer for each elementIOException - If an I/O error occurs<K,V> void writeMap(int tag,
String name,
Map<K,V> map,
ValueSerializer<K> keySerializer,
ValueSerializer<V> valueSerializer)
throws IOException
K - the type of keys in the mapV - the type of values in the maptag - the tag valuename - the tag namemap - the map to writekeySerializer - the serializer for each keyvalueSerializer - the serializer for each valueIOException - If an I/O error occurs<T extends Message> void writeMessage(int tag, String name, T message, MessageSerializer<T> serializer) throws IOException
T - the type of messagetag - the tag valuename - the tag namemessage - the message to writeserializer - the serializer for the messageIOException - If an I/O error occurs<T> void writeSet(int tag,
String name,
Set<T> set,
ValueSerializer<T> serializer)
throws IOException
T - the type of elementstag - the tag valuename - the tag nameset - the set to writeserializer - the serializer for each elementIOException - If an I/O error occursvoid writeText(int tag,
String name,
String value)
throws IOException
tag - the tag valuename - the tag namevalue - the string value to writeIOException - If an I/O error occursCopyright © 2012–2015 Danish Maritime Authority. All rights reserved.