Interface HistoryFlavorCodec
public interface HistoryFlavorCodec
A HistoryFlavorCodec knows how to encode and decode a certain history flavor in binary and potentially
several text formats.
It will be used to import and export data from the store and forward system, and the binary encoding will be used to store the the data cache.
Versioning If a codec changes over time, new instances should be registered for each version. On export or new data, the latest version will be used, but on decode the correct version will be retrieved.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HistoryFlavorCodec.TextFormat
static final HistoryFlavorCodec.TextFormat
static final HistoryFlavorCodec.TextFormat
-
Method Summary
Modifier and TypeMethodDescriptiondecode
(byte[] bytes) byte[]
encode
(HistoricalData data) void
encodeText
(Writer w, HistoricalData data, HistoryFlavorCodec.TextFormat fmt) int
version()
Returns the version of this codec instance.
-
Field Details
-
XML
-
CSV
-
JSON
-
-
Method Details
-
version
int version()Returns the version of this codec instance. -
encode
-
decode
-
getSupportedTextFormats
List<HistoryFlavorCodec.TextFormat> getSupportedTextFormats() -
encodeText
void encodeText(Writer w, HistoricalData data, HistoryFlavorCodec.TextFormat fmt) throws IOException - Throws:
IOException
-
decodeText
- Throws:
IOException
-