Class ByteArrayCodec

  • All Implemented Interfaces:
    Codec<byte[]>

    public final class ByteArrayCodec
    extends BaseCodec<byte[]>
    Codec for encoding and decoding FQL byte arrays.
    • Constructor Detail

      • ByteArrayCodec

        public ByteArrayCodec()
    • Method Detail

      • decode

        public byte[] decode​(UTF8FaunaParser parser)
                      throws CodecException
        Decodes a byte array from the parser.
        Parameters:
        parser - the parser to read from
        Returns:
        the decoded byte array, or null if the token represents a null value
        Throws:
        CodecException - if decoding fails due to an unexpected type
      • encode

        public void encode​(UTF8FaunaGenerator gen,
                           byte[] obj)
                    throws CodecException
        Encodes a byte array to the generator.
        Parameters:
        gen - the generator to write to
        obj - the byte array to encode
        Throws:
        CodecException - if encoding fails
      • getCodecClass

        public java.lang.Class<?> getCodecClass()
        Returns the class type this codec supports.
        Returns:
        byte array class
      • getSupportedTypes

        public FaunaType[] getSupportedTypes()
        Returns the Fauna types this codec supports.
        Returns:
        supported Fauna types