public class BinaryRowProtocol extends RowProtocol
Modifier and Type | Field and Description |
---|---|
private ColumnInformation[] |
columnInformation |
private int |
columnInformationLength |
BIT_LAST_FIELD_NOT_NULL, BIT_LAST_FIELD_NULL, BIT_LAST_ZERO_DATE, buf, index, isIntegerRegex, lastValueNull, length, maxFieldSize, NULL_LENGTH, options, pos, TEXT_LOCAL_DATE_TIME, TEXT_OFFSET_DATE_TIME, TEXT_ZONED_DATE_TIME, TINYINT1_IS_BIT, YEAR_IS_DATE_TYPE
Constructor and Description |
---|
BinaryRowProtocol(ColumnInformation[] columnInformation,
int columnInformationLength,
int maxFieldSize,
Options options)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.math.BigDecimal |
getInternalBigDecimal(ColumnInformation columnInfo)
Get BigDecimal from raw binary format.
|
java.math.BigInteger |
getInternalBigInteger(ColumnInformation columnInfo)
Get BigInteger from raw binary format.
|
boolean |
getInternalBoolean(ColumnInformation columnInfo)
Get boolean from raw binary format.
|
byte |
getInternalByte(ColumnInformation columnInfo)
Get byte from raw binary format.
|
java.sql.Date |
getInternalDate(ColumnInformation columnInfo,
java.util.Calendar cal,
java.util.TimeZone timeZone)
Get date from raw binary format.
|
double |
getInternalDouble(ColumnInformation columnInfo)
Get double from raw binary format.
|
float |
getInternalFloat(ColumnInformation columnInfo)
Get float from raw binary format.
|
int |
getInternalInt(ColumnInformation columnInfo)
Get int from raw binary format.
|
java.time.LocalDate |
getInternalLocalDate(ColumnInformation columnInfo,
java.util.TimeZone timeZone)
Get LocalDate from raw binary format.
|
java.time.LocalTime |
getInternalLocalTime(ColumnInformation columnInfo,
java.util.TimeZone timeZone)
Get LocalTime from raw binary format.
|
long |
getInternalLong(ColumnInformation columnInfo)
Get long from raw binary format.
|
java.lang.Object |
getInternalObject(ColumnInformation columnInfo,
java.util.TimeZone timeZone)
Get Object from raw binary format.
|
java.time.OffsetTime |
getInternalOffsetTime(ColumnInformation columnInfo,
java.util.TimeZone timeZone)
Get OffsetTime from raw binary format.
|
short |
getInternalShort(ColumnInformation columnInfo)
Get short from raw binary format.
|
java.lang.String |
getInternalString(ColumnInformation columnInfo,
java.util.Calendar cal,
java.util.TimeZone timeZone)
Get string from raw binary format.
|
java.sql.Time |
getInternalTime(ColumnInformation columnInfo,
java.util.Calendar cal,
java.util.TimeZone timeZone)
Get time from raw binary format.
|
java.sql.Timestamp |
getInternalTimestamp(ColumnInformation columnInfo,
java.util.Calendar userCalendar,
java.util.TimeZone timeZone)
Get timestamp from raw binary format.
|
java.lang.String |
getInternalTimeString(ColumnInformation columnInfo)
Get Time in string format from raw binary format.
|
java.time.ZonedDateTime |
getInternalZonedDateTime(ColumnInformation columnInfo,
java.lang.Class clazz,
java.util.TimeZone timeZone)
Get ZonedDateTime from raw binary format.
|
boolean |
isBinaryEncoded()
Indicate if data is binary encoded.
|
void |
setPosition(int newIndex)
Set length and pos indicator to asked index.
|
extractNanos, getInternalMediumInt, getInternalSmallInt, getInternalTinyInt, getLengthMaxFieldSize, getMaxFieldSize, lastValueWasNull, parseBit, rangeCheck, rangeCheck, resetRow, wasNull, zeroFillingIfNeeded
private final ColumnInformation[] columnInformation
private final int columnInformationLength
public BinaryRowProtocol(ColumnInformation[] columnInformation, int columnInformationLength, int maxFieldSize, Options options)
columnInformation
- column information.columnInformationLength
- number of columnsmaxFieldSize
- max field sizeoptions
- connection optionspublic void setPosition(int newIndex)
setPosition
in class RowProtocol
newIndex
- index (0 is first).public java.lang.String getInternalString(ColumnInformation columnInfo, java.util.Calendar cal, java.util.TimeZone timeZone) throws java.sql.SQLException
getInternalString
in class RowProtocol
columnInfo
- column informationcal
- calendartimeZone
- time zonejava.sql.SQLException
- if conversion failedpublic int getInternalInt(ColumnInformation columnInfo) throws java.sql.SQLException
getInternalInt
in class RowProtocol
columnInfo
- column informationjava.sql.SQLException
- if column is not numeric or is not in Integer bounds.public long getInternalLong(ColumnInformation columnInfo) throws java.sql.SQLException
getInternalLong
in class RowProtocol
columnInfo
- column informationjava.sql.SQLException
- if column is not numeric or is not in Long bounds (for big unsigned
values)public float getInternalFloat(ColumnInformation columnInfo) throws java.sql.SQLException
getInternalFloat
in class RowProtocol
columnInfo
- column informationjava.sql.SQLException
- if column is not numeric or is not in Float bounds.public double getInternalDouble(ColumnInformation columnInfo) throws java.sql.SQLException
getInternalDouble
in class RowProtocol
columnInfo
- column informationjava.sql.SQLException
- if column is not numeric or is not in Double bounds (unsigned columns).public java.math.BigDecimal getInternalBigDecimal(ColumnInformation columnInfo) throws java.sql.SQLException
getInternalBigDecimal
in class RowProtocol
columnInfo
- column informationjava.sql.SQLException
- if column is not numericpublic java.sql.Date getInternalDate(ColumnInformation columnInfo, java.util.Calendar cal, java.util.TimeZone timeZone) throws java.sql.SQLException
getInternalDate
in class RowProtocol
columnInfo
- column informationcal
- calendartimeZone
- time zonejava.sql.SQLException
- if column is not compatible to Datepublic java.sql.Time getInternalTime(ColumnInformation columnInfo, java.util.Calendar cal, java.util.TimeZone timeZone) throws java.sql.SQLException
getInternalTime
in class RowProtocol
columnInfo
- column informationcal
- calendartimeZone
- time zonejava.sql.SQLException
- if column cannot be converted to Timepublic java.sql.Timestamp getInternalTimestamp(ColumnInformation columnInfo, java.util.Calendar userCalendar, java.util.TimeZone timeZone) throws java.sql.SQLException
getInternalTimestamp
in class RowProtocol
columnInfo
- column informationuserCalendar
- user calendartimeZone
- time zonejava.sql.SQLException
- if column type is not compatiblepublic java.lang.Object getInternalObject(ColumnInformation columnInfo, java.util.TimeZone timeZone) throws java.sql.SQLException
getInternalObject
in class RowProtocol
columnInfo
- column informationtimeZone
- time zonejava.sql.SQLException
- if column type is not compatiblepublic boolean getInternalBoolean(ColumnInformation columnInfo) throws java.sql.SQLException
getInternalBoolean
in class RowProtocol
columnInfo
- column informationjava.sql.SQLException
- if column type doesn't permit conversionpublic byte getInternalByte(ColumnInformation columnInfo) throws java.sql.SQLException
getInternalByte
in class RowProtocol
columnInfo
- column informationjava.sql.SQLException
- if column type doesn't permit conversionpublic short getInternalShort(ColumnInformation columnInfo) throws java.sql.SQLException
getInternalShort
in class RowProtocol
columnInfo
- column informationjava.sql.SQLException
- if column type doesn't permit conversionpublic java.lang.String getInternalTimeString(ColumnInformation columnInfo)
getInternalTimeString
in class RowProtocol
columnInfo
- column informationpublic java.math.BigInteger getInternalBigInteger(ColumnInformation columnInfo) throws java.sql.SQLException
getInternalBigInteger
in class RowProtocol
columnInfo
- column informationjava.sql.SQLException
- if column type doesn't permit conversion or value is not in BigInteger
rangepublic java.time.ZonedDateTime getInternalZonedDateTime(ColumnInformation columnInfo, java.lang.Class clazz, java.util.TimeZone timeZone) throws java.sql.SQLException
getInternalZonedDateTime
in class RowProtocol
columnInfo
- column informationclazz
- asked classtimeZone
- time zonejava.sql.SQLException
- if column type doesn't permit conversionpublic java.time.OffsetTime getInternalOffsetTime(ColumnInformation columnInfo, java.util.TimeZone timeZone) throws java.sql.SQLException
getInternalOffsetTime
in class RowProtocol
columnInfo
- column informationtimeZone
- time zonejava.sql.SQLException
- if column type doesn't permit conversionpublic java.time.LocalTime getInternalLocalTime(ColumnInformation columnInfo, java.util.TimeZone timeZone) throws java.sql.SQLException
getInternalLocalTime
in class RowProtocol
columnInfo
- column informationtimeZone
- time zonejava.sql.SQLException
- if column type doesn't permit conversionpublic java.time.LocalDate getInternalLocalDate(ColumnInformation columnInfo, java.util.TimeZone timeZone) throws java.sql.SQLException
getInternalLocalDate
in class RowProtocol
columnInfo
- column informationtimeZone
- time zonejava.sql.SQLException
- if column type doesn't permit conversionpublic boolean isBinaryEncoded()
isBinaryEncoded
in class RowProtocol