Class BinaryDtoConvertingFieldCodec<R,T>
java.lang.Object
io.datarouter.bytes.binarydto.fieldcodec.BinaryDtoBaseFieldCodec<R>
io.datarouter.bytes.binarydto.fieldcodec.BinaryDtoConvertingFieldCodec<R,T>
public class BinaryDtoConvertingFieldCodec<R,T> extends BinaryDtoBaseFieldCodec<R>
-
Constructor Summary
Constructors Constructor Description BinaryDtoConvertingFieldCodec(Codec<R,T> converter, BinaryDtoBaseFieldCodec<T> codec)BinaryDtoConvertingFieldCodec(Function<R,T> convertTo, Function<T,R> convertFrom, BinaryDtoBaseFieldCodec<T> codec) -
Method Summary
Modifier and Type Method Description Rdecode(byte[] bytes, int offset)LengthAndValue<R>decodeWithLength(byte[] bytes, int offset)byte[]encode(R value)intfixedLength()booleanisFixedLength()Methods inherited from class io.datarouter.bytes.binarydto.fieldcodec.BinaryDtoBaseFieldCodec
compareAsIfEncoded, decodeLength
-
Constructor Details
-
Method Details
-
isFixedLength
public boolean isFixedLength()- Overrides:
isFixedLengthin classBinaryDtoBaseFieldCodec<R>
-
fixedLength
public int fixedLength()- Overrides:
fixedLengthin classBinaryDtoBaseFieldCodec<R>
-
encode
- Specified by:
encodein classBinaryDtoBaseFieldCodec<R>
-
decode
- Overrides:
decodein classBinaryDtoBaseFieldCodec<R>
-
decodeWithLength
- Specified by:
decodeWithLengthin classBinaryDtoBaseFieldCodec<R>
-