Package org.yamcs.yarch
Class ParameterValueColumnSerializer
- java.lang.Object
-
- org.yamcs.yarch.ParameterValueColumnSerializer
-
- All Implemented Interfaces:
ColumnSerializer<ParameterValue>
public class ParameterValueColumnSerializer extends Object
-
-
Constructor Summary
Constructors Constructor Description ParameterValueColumnSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ParameterValuedeserialize(DataInputStream stream, ColumnDefinition cd)Read one column value (i.e. a cell from the stream) The enums are deserialized as shorts (it is converted to the actual type in theTableDefinition.deserialize(byte[], byte[]))ParameterValuedeserialize(ByteBuffer byteBuf, ColumnDefinition cd)Same as above but read the data from a ByteBuffer.TfromByteArray(byte[] b, ColumnDefinition cd)this method deserializes the value from a byte arrayvoidserialize(DataOutputStream stream, ParameterValue pv)voidserialize(ByteBuffer byteBuf, ParameterValue pv)Same as above but serialize into a bytebuffer.byte[]toByteArray(T v)This method serializes the value into a byte arrayDb.ParameterValuetoProto(ParameterValue pv)
-
-
-
Method Detail
-
deserialize
public ParameterValue deserialize(DataInputStream stream, ColumnDefinition cd) throws IOException
Description copied from interface:ColumnSerializerRead one column value (i.e. a cell from the stream) The enums are deserialized as shorts (it is converted to the actual type in theTableDefinition.deserialize(byte[], byte[]))- Parameters:
stream- - data stream used for the inputcd- the column definition for the involved column (can be used to look up column name or other properties to help in deserialization)- Returns:
- the deserialized value
- Throws:
IOException
-
deserialize
public ParameterValue deserialize(ByteBuffer byteBuf, ColumnDefinition cd) throws IOException
Description copied from interface:ColumnSerializerSame as above but read the data from a ByteBuffer.If the buffer is not long enough, it throws an
BufferUnderflowException.- Returns:
- Throws:
IOException
-
serialize
public void serialize(DataOutputStream stream, ParameterValue pv) throws IOException
- Throws:
IOException
-
serialize
public void serialize(ByteBuffer byteBuf, ParameterValue pv)
Description copied from interface:ColumnSerializerSame as above but serialize into a bytebuffer. If the ByteBuffer is not large enough, aBufferOverflowExceptionwill be thrown.
-
toProto
public Db.ParameterValue toProto(ParameterValue pv)
-
fromByteArray
public T fromByteArray(byte[] b, ColumnDefinition cd) throws IOExceptionDescription copied from interface:ColumnSerializerthis method deserializes the value from a byte array- Specified by:
fromByteArrayin interfaceColumnSerializer<T>- Parameters:
b- the input byte arraycd- the column definition for the involved column (can be used to look up column name or other properties to help in deserialization)- Returns:
- the deserialized value
- Throws:
IOException
-
toByteArray
public byte[] toByteArray(T v)
Description copied from interface:ColumnSerializerThis method serializes the value into a byte array- Specified by:
toByteArrayin interfaceColumnSerializer<T>- Returns:
- the resulting byte array
-
-