public interface Encoder
Accepts a stream of KeyValues. This can be used to anywhere KeyValues need to be written out, but
currently it is only used for serializing WALEdits. This could be backed by a List, but
more efficient implementations will append results to a byte to eliminate overhead, and
possibly encode the underlying data further.
To read the data back, use a corresponding Decoder
Implementation must copy the entire state of the cell. If the written cell is modified
immediately after the write method returns, the modifications must have absolutely no effect on
the copy of the cell that was added in the write.
Let the implementation decide what to do. Usually means writing accumulated data into a
byte that can then be read from the implementation to be sent to disk, put in the block
cache, or sent over the network.