public class BinaryBufferRow extends AbstractBufferRow
| Modifier and Type | Field and Description |
|---|---|
private boolean[] |
isNull
If binary-encoded, the NULL status of each column is at the beginning of the row, so we
|
private int |
preNullBitmaskHomePosition
The home position before the is-null bitmask for server-side prepared statement result sets
|
homePosition, lastRequestedIndex, lastRequestedPos, rowFromServerexceptionInterceptor, metadata, valueDecoder, wasNull| Constructor and Description |
|---|
BinaryBufferRow(NativePacketPayload buf,
ColumnDefinition cd,
ExceptionInterceptor exceptionInterceptor,
ValueDecoder valueDecoder) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
findAndSeekToOffset(int index) |
byte[] |
getBytes(int index)
Returns the value at the given column as a byte array.
|
boolean |
getNull(int columnIndex)
Check whether a column is NULL and update the 'wasNull' status.
|
<T> T |
getValue(int columnIndex,
ValueFactory<T> vf)
Implementation of getValue() based on the underlying Buffer object.
|
boolean |
isBinaryEncoded() |
void |
setBytes(int columnIndex,
byte[] value)
Sets the given byte array as a raw column value (only works currently with ByteArrayRow).
|
Row |
setMetadata(ColumnDefinition f)
Set metadata to enable getValue functionality.
|
private void |
setupIsNullBitmask()
Unpacks the bitmask at the head of the row packet that tells us what
columns hold null values, and sets the "home" position directly after the
bitmask.
|
getValueFromBytes, wasNullprivate int preNullBitmaskHomePosition
private boolean[] isNull
public BinaryBufferRow(NativePacketPayload buf, ColumnDefinition cd, ExceptionInterceptor exceptionInterceptor, ValueDecoder valueDecoder)
public boolean isBinaryEncoded()
protected int findAndSeekToOffset(int index)
findAndSeekToOffset in class AbstractBufferRowpublic byte[] getBytes(int index)
Rowindex - index of column (starting at 0) to return from.NULL, the value returned is nullpublic boolean getNull(int columnIndex)
columnIndex - of the column value (starting at 0) to check.public Row setMetadata(ColumnDefinition f)
RowsetMetadata in interface RowsetMetadata in class AbstractResultsetRowf - ColumnDefinitionRowprivate void setupIsNullBitmask()
public <T> T getValue(int columnIndex,
ValueFactory<T> vf)
T - type to decode tocolumnIndex - index of column to retrieve value from (0-indexed, not JDBC 1-indexed)vf - value factory used to create the return value after decodingpublic void setBytes(int columnIndex,
byte[] value)
RowcolumnIndex - index of the column (starting at 0) to set to.value - the (raw) value to set