N - The base type of array.private abstract static class ArrayEncoding.NumberArrayEncoder<N extends java.lang.Number> extends ArrayEncoding.AbstractArrayEncoder<N[]>
Number based arrays.| Modifier and Type | Field and Description |
|---|---|
private int |
fieldSize |
arrayOid| Constructor and Description |
|---|
NumberArrayEncoder(int fieldSize,
int oid,
int arrayOid) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendArray(java.lang.StringBuilder sb,
char delim,
N[] array) |
(package private) int |
countNulls(N[] array)
Counts the number of
null elements in array. |
byte[] |
toBinaryRepresentation(BaseConnection connection,
N[] array,
int oid) |
(package private) byte[] |
toSingleDimensionBinaryRepresentation(BaseConnection connection,
N[] array)
Creates
byte[] of just the raw data (no metadata). |
protected abstract void |
write(N number,
byte[] bytes,
int offset)
Write single value (number) to bytes beginning at
offset.
|
private byte[] |
writeBytes(N[] array,
int nullCount,
int offset) |
getDefaultArrayTypeOid, getTypeOID, supportBinaryRepresentation, toArrayStringNumberArrayEncoder(int fieldSize,
int oid,
int arrayOid)
fieldSize - The fixed size to represent each value in binary.oid - The base type oid.arrayOid - The array type oid.final int countNulls(N[] array)
null elements in array.countNulls in class ArrayEncoding.AbstractArrayEncoder<N extends java.lang.Number[]>array - The array to count null elements in.null elements in array.public final byte[] toBinaryRepresentation(BaseConnection connection, N[] array, int oid) throws java.sql.SQLException, java.sql.SQLFeatureNotSupportedException
java.sql.SQLExceptionjava.sql.SQLFeatureNotSupportedExceptionfinal byte[] toSingleDimensionBinaryRepresentation(BaseConnection connection, N[] array) throws java.sql.SQLException, java.sql.SQLFeatureNotSupportedException
byte[] of just the raw data (no metadata).toSingleDimensionBinaryRepresentation in class ArrayEncoding.AbstractArrayEncoder<N extends java.lang.Number[]>connection - The connection the binary representation will be used on.array - The array to create binary representation of. Will not be
null, but may contain null elements.byte[] of just the raw data (no metadata).java.sql.SQLFeatureNotSupportedException - If ArrayEncoding.AbstractArrayEncoder.supportBinaryRepresentation(int) is false for
oid.java.sql.SQLExceptionprivate byte[] writeBytes(N[] array, int nullCount, int offset)
protected abstract void write(N number, byte[] bytes, int offset)
number - The value to write to bytes. This will never be null.bytes - The byte[] to write to.offset - The offset into bytes to write the number value.public final void appendArray(java.lang.StringBuilder sb,
char delim,
N[] array)