ICodec<T>
- Namespace
- Rowles.LeanCorpus.Codecs.CodecKit.Codecs
- Assembly
- Rowles.LeanCorpus.dll
A typed, bidirectional codec that encodes values of type T to bytes
and decodes bytes back to values of type T.
Implementations must be immutable and thread-safe. All mutable state lives in CodecContext.
public interface ICodec<T>
Type Parameters
T
- Extension Methods
Decode(ref SequenceReader<byte>, CodecContext)
Decodes a value of type T from the reader.
On failure, the reader position is restored to its state before this call (atomicity).
Encode(T, IBufferWriter<byte>, CodecContext)
Encodes value into the writer.