Package org.mariadb.jdbc.codec.list

## Class ByteArrayCodec

- java.lang.Object
- - org.mariadb.jdbc.codec.list.ByteArrayCodec

All Implemented Interfaces:
  `org.mariadb.jdbc.codec.Codec<byte[]>`

    public class ByteArrayCodec
    extends Object
    implements org.mariadb.jdbc.codec.Codec<byte[]>

### Field Summary

Fields
`static byte[]` `BINARY_PREFIX`
`static ByteArrayCodec` `INSTANCE`

### Constructor Summary

Constructors
`ByteArrayCodec()`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `canDecode​(ColumnDefinitionPacket column, Class<?> type)`
`boolean` `canEncode​(Object value)`
`String` `className()`
`byte[]` `decodeBinary​(org.mariadb.jdbc.client.ReadableByteBuf buf, int length, ColumnDefinitionPacket column, Calendar cal)`
`byte[]` `decodeText​(org.mariadb.jdbc.client.ReadableByteBuf buf, int length, ColumnDefinitionPacket column, Calendar cal)`
`void` `encodeBinary​(PacketWriter encoder, Object value, Calendar cal, Long maxLength)`
`void` `encodeText​(PacketWriter encoder, Context context, Object value, Calendar cal, Long maxLength)`
`int` `getBinaryEncodeType()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.mariadb.jdbc.codec.Codec

`canEncodeLongData, encodeData, encodeLongData`

### Field Detail

#### BINARY_PREFIX

    public static final byte[] BINARY_PREFIX

#### INSTANCE

    public static final ByteArrayCodec INSTANCE

### Constructor Detail

#### ByteArrayCodec

    public ByteArrayCodec()

### Method Detail

#### className

    public String className()

Specified by:
  `className` in interface `org.mariadb.jdbc.codec.Codec<byte[]>`

#### canDecode

    public boolean canDecode​(ColumnDefinitionPacket column,
                             Class<?> type)

Specified by:
  `canDecode` in interface `org.mariadb.jdbc.codec.Codec<byte[]>`

#### canEncode

    public boolean canEncode​(Object value)

Specified by:
  `canEncode` in interface `org.mariadb.jdbc.codec.Codec<byte[]>`

#### decodeText

    public byte[] decodeText​(org.mariadb.jdbc.client.ReadableByteBuf buf,
                             int length,
                             ColumnDefinitionPacket column,
                             Calendar cal)
                      throws SQLDataException

Specified by:
  `decodeText` in interface `org.mariadb.jdbc.codec.Codec<byte[]>`
Throws:
  `SQLDataException`

#### decodeBinary

    public byte[] decodeBinary​(org.mariadb.jdbc.client.ReadableByteBuf buf,
                               int length,
                               ColumnDefinitionPacket column,
                               Calendar cal)
                        throws SQLDataException

Specified by:
  `decodeBinary` in interface `org.mariadb.jdbc.codec.Codec<byte[]>`
Throws:
  `SQLDataException`

#### encodeText

    public void encodeText​(PacketWriter encoder,
                           Context context,
                           Object value,
                           Calendar cal,
                           Long maxLength)
                    throws IOException

Specified by:
  `encodeText` in interface `org.mariadb.jdbc.codec.Codec<byte[]>`
Throws:
  `IOException`

#### encodeBinary

    public void encodeBinary​(PacketWriter encoder,
                             Object value,
                             Calendar cal,
                             Long maxLength)
                      throws IOException

Specified by:
  `encodeBinary` in interface `org.mariadb.jdbc.codec.Codec<byte[]>`
Throws:
  `IOException`

#### getBinaryEncodeType

    public int getBinaryEncodeType()

Specified by:
  `getBinaryEncodeType` in interface `org.mariadb.jdbc.codec.Codec<byte[]>`