Class BinaryDtoBaseFieldCodec<T>

java.lang.Object
io.datarouter.bytes.binarydto.fieldcodec.BinaryDtoBaseFieldCodec<T>
Direct Known Subclasses:
BinaryDtoConvertingFieldCodec, BinaryDtoField.BinaryDtoInvalidCodec, BooleanArrayBinaryDtoFieldCodec, BooleanBinaryDtoFieldCodec, ByteArrayBinaryDtoFieldCodec, ByteBinaryDtoFieldCodec, CharArrayBinaryDtoFieldCodec, CharBinaryDtoFieldCodec, DoubleArrayBinaryDtoFieldCodec, DoubleBinaryDtoFieldCodec, EnumBinaryDtoFieldCodec, FloatArrayBinaryDtoFieldCodec, FloatBinaryDtoFieldCodec, InstantBinaryDtoFieldCodec, IntArrayBinaryDtoFieldCodec, IntBinaryDtoFieldCodec, ListBinaryDtoFieldCodec, LongArrayBinaryDtoFieldCodec, LongBinaryDtoFieldCodec, NestedBinaryDtoFieldCodec, ObjectArrayBinaryDtoFieldCodec, PrefixedUtf8BinaryDtoFieldCodec, ShortArrayBinaryDtoFieldCodec, ShortBinaryDtoFieldCodec, SignedByteArrayBinaryDtoFieldCodec, TerminatedUtf8BinaryDtoFieldCodec, VarIntBinaryDtoFieldCodec

public abstract class BinaryDtoBaseFieldCodec<T>
extends Object
  • Constructor Details

    • BinaryDtoBaseFieldCodec

      public BinaryDtoBaseFieldCodec()
  • Method Details

    • isFixedLength

      public boolean isFixedLength()
    • fixedLength

      public int fixedLength()
    • encode

      public abstract byte[] encode​(T value)
    • decode

      public T decode​(byte[] bytes, int offset)
    • decodeWithLength

      public abstract LengthAndValue<T> decodeWithLength​(byte[] bytes, int offset)
    • decodeLength

      public int decodeLength​(byte[] bytes, int offset)
      Override this with optimized implementations that avoid value decoding.
    • compareAsIfEncoded

      public int compareAsIfEncoded​(T left, T right)
      Override this with optimized implementations that avoid encoding.