public class DefaultBlrCalculator extends java.lang.Object implements BlrCalculator
Most likely this can be used without change for other protocol versions as well, although we may need to investigate
the TODOs specified in calculateBlr(org.firebirdsql.gds.ng.fields.RowDescriptor).
| Modifier and Type | Field and Description |
|---|---|
static DefaultBlrCalculator |
CALCULATOR_DIALECT_3
Cached instance of
DefaultBlrCalculator for dialect 3 databases. |
| Constructor and Description |
|---|
DefaultBlrCalculator(short dialect) |
| Modifier and Type | Method and Description |
|---|---|
int |
calculateBatchMessageLength(RowDescriptor rowDescriptor)
Calculates the batch message length.
|
byte[] |
calculateBlr(RowDescriptor rowDescriptor)
Calculates the blr for the row descriptor.
|
byte[] |
calculateBlr(RowDescriptor rowDescriptor,
RowValue rowValue)
Calculates the blr for a specific row value.
|
int |
calculateIoLength(FieldDescriptor fieldDescriptor)
Calculates the io length for the field descriptor.
|
int |
calculateIoLength(FieldDescriptor fieldDescriptor,
byte[] fieldData)
Calculates the io length for the field descriptor and actual data.
|
public static final DefaultBlrCalculator CALCULATOR_DIALECT_3
DefaultBlrCalculator for dialect 3 databases.public byte[] calculateBlr(RowDescriptor rowDescriptor) throws java.sql.SQLException
BlrCalculatorcalculateBlr in interface BlrCalculatorrowDescriptor - Row descriptorjava.sql.SQLException - When the RowDescriptor contains an unsupported field type.public byte[] calculateBlr(RowDescriptor rowDescriptor, RowValue rowValue) throws java.sql.SQLException
BlrCalculatorThis allows to optimize for the actual length of the field.
calculateBlr in interface BlrCalculatorrowDescriptor - Row descriptorrowValue - Row valuejava.sql.SQLException - When the RowValue contains an unsupported field type.public int calculateIoLength(FieldDescriptor fieldDescriptor) throws java.sql.SQLException
BlrCalculatorThe return value indicates the length and padding of the type in the buffer
calculateIoLength in interface BlrCalculatorfieldDescriptor - Field descriptorjava.sql.SQLExceptionpublic int calculateIoLength(FieldDescriptor fieldDescriptor, byte[] fieldData) throws java.sql.SQLException
BlrCalculatorThe return value indicates the length and padding of the type in the buffer
This allows to optimize for the actual length of the field.
For CHAR (ISCConstants.SQL_TEXT the implementation should be consistent
with the lengths as given by BlrCalculator.calculateIoLength(FieldDescriptor).
calculateIoLength in interface BlrCalculatorfieldDescriptor - Field descriptorfieldData - byte array (can be null) with field data.java.sql.SQLExceptionpublic int calculateBatchMessageLength(RowDescriptor rowDescriptor) throws java.sql.SQLException
BlrCalculatorcalculateBatchMessageLength in interface BlrCalculatorrowDescriptor - row descriptorjava.sql.SQLException - when the RowDescriptor contains an unsupported field type.Copyright © 2001-2024 Jaybird (Firebird JDBC) team. All rights reserved.