Class KvFileBlockCodec<T>

java.lang.Object
io.datarouter.bytes.kvfile.codec.KvFileBlockCodec<T>
All Implemented Interfaces:
Codec<List<T>,byte[]>

public class KvFileBlockCodec<T> extends Object implements Codec<List<T>,byte[]>
Translates a List of user-provided items to a byte[]. Intended for use in Blockfiles of Kvs. Use the identity() method for things like merging Kvs from multiple files without decoding to the user-provided type.
  • Constructor Details

  • Method Details

    • identity

      public static Codec<List<KvFileEntry>,byte[]> identity()
      Description copied from interface: Codec
      Use Codec.identity() when you must supply a Codec but don't need to encode anything.
    • encode

      public byte[] encode(List<T> value)
      Specified by:
      encode in interface Codec<List<T>,byte[]>
    • decode

      public List<T> decode(byte[] encodedValue)
      Specified by:
      decode in interface Codec<List<T>,byte[]>