private static final class ArrayEncoding.TwoDimensionPrimitiveArrayEncoder<A> extends java.lang.Object implements ArrayEncoding.ArrayEncoder<A[]>
ArrayEncoding.AbstractArrayEncoder
implementation and provides optimized
support for 2 dimensions.Modifier and Type | Field and Description |
---|---|
private ArrayEncoding.AbstractArrayEncoder<A> |
support |
Constructor and Description |
---|
TwoDimensionPrimitiveArrayEncoder(ArrayEncoding.AbstractArrayEncoder<A> support) |
Modifier and Type | Method and Description |
---|---|
int |
getDefaultArrayTypeOid()
The default array type oid supported by this instance.
|
boolean |
supportBinaryRepresentation(int oid)
Indicates if an array can be encoded in binary form to array oid.
|
java.lang.String |
toArrayString(char delim,
A[] array)
Creates
String representation of the array. |
byte[] |
toBinaryRepresentation(BaseConnection connection,
A[] array,
int oid)
Creates binary representation of the array.
|
private final ArrayEncoding.AbstractArrayEncoder<A> support
TwoDimensionPrimitiveArrayEncoder(ArrayEncoding.AbstractArrayEncoder<A> support)
support
- The instance providing support for the base array type.public int getDefaultArrayTypeOid()
getDefaultArrayTypeOid
in interface ArrayEncoding.ArrayEncoder<A[]>
public java.lang.String toArrayString(char delim, A[] array)
String
representation of the array.toArrayString
in interface ArrayEncoding.ArrayEncoder<A[]>
delim
- The character to use to delimit between elements.array
- The array to represent as a String
.String
representation of the array.public boolean supportBinaryRepresentation(int oid)
supportBinaryRepresentation
in interface ArrayEncoding.ArrayEncoder<A[]>
oid
- The array oid to see check for binary support.ArrayEncoding.ArrayEncoder.toBinaryRepresentation(BaseConnection, Object, int)
is
supported for oid.public byte[] toBinaryRepresentation(BaseConnection connection, A[] array, int oid) throws java.sql.SQLException, java.sql.SQLFeatureNotSupportedException
toBinaryRepresentation
in interface ArrayEncoding.ArrayEncoder<A[]>
connection
- The connection the binary representation will be used on. Attributes
from the connection might impact how values are translated to
binary.array
- The array to binary encode. Must not be null
, but may
contain null
elements.oid
- The array type oid to use. Calls to
ArrayEncoding.ArrayEncoder.supportBinaryRepresentation(int)
must have returned
true
.java.sql.SQLFeatureNotSupportedException
- If ArrayEncoding.ArrayEncoder.supportBinaryRepresentation(int)
is false for
oid.java.sql.SQLException