Package io.datarouter.bytes
Interface Codec<A,B>
- All Known Implementing Classes:
BlockfileHeader.BlockfileHeaderCodec,ByteArraysCodec,Codec.FunctionalCodec,Codec.NullPassthroughCodec,GzipStatefulCodec,KvFileHeader.KvFileHeaderCodec,RawLongListCodec,StringCodec
public interface Codec<A,B>
A bi-directional Function where encoding then decoding should typically return the original value.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classBuild a Codec from two Functions.static classSkips the inner codecs when provided values are null, directly returning null. -
Field Summary
Fields -
Method Summary
-
Field Details
-
IDENTITY_INSTANCE
-
-
Method Details
-
encode
-
decode
-
encodeAndDecode
Useful for testing -
of
-
identity
Use Codec.identity() when you must supply a Codec but don't need to encode anything.
-