public interface DatatypeCoder
| Modifier and Type | Interface and Description |
|---|---|
static class |
DatatypeCoder.RawDateTimeStruct
Deprecated.
use a
java.time type; will be removed in Jaybird 6 |
| Modifier and Type | Field and Description |
|---|---|
static int |
FRACTIONS_PER_HOUR |
static int |
FRACTIONS_PER_MILLISECOND |
static int |
FRACTIONS_PER_MINUTE |
static int |
FRACTIONS_PER_SECOND |
static int |
NANOSECONDS_PER_FRACTION |
| Modifier and Type | Method and Description |
|---|---|
java.io.Reader |
createReader(java.io.InputStream inputStream)
Creates a reader wrapping an input stream.
|
java.io.Writer |
createWriter(java.io.OutputStream outputStream)
Creates a writer wrapping an input stream.
|
boolean |
decodeBoolean(byte[] data)
Decode boolean from supplied data.
|
java.sql.Date |
decodeDate(java.sql.Date d,
java.util.Calendar cal)
Deprecated.
will be removed in Jaybird 6
|
java.sql.Date |
decodeDateCalendar(byte[] byte_int,
java.util.Calendar c)
Deprecated.
use
decodeLocalDate(byte[]); will be removed in Jaybird 6 |
DatatypeCoder.RawDateTimeStruct |
decodeDateRaw(byte[] byte_int)
Deprecated.
use
decodeLocalDate(byte[]); will be removed in Jaybird 6 |
Decimal128 |
decodeDecimal128(byte[] data)
Decodes a decimal128 from byte array.
|
Decimal64 |
decodeDecimal64(byte[] data)
Decodes a decimal64 from byte array.
|
double |
decodeDouble(byte[] byte_int)
Decode a
byte array into a double value. |
float |
decodeFloat(byte[] byte_int)
Decode a
byte array into a float value. |
int |
decodeInt(byte[] byte_int)
Decode a
byte array into an int value. |
int |
decodeInt(byte[] bytes,
int fromIndex)
Decode a
byte array to an int value. |
java.math.BigInteger |
decodeInt128(byte[] data)
Decodes a BigInteger from byte array.
|
java.time.LocalDate |
decodeLocalDate(byte[] data)
Decode LocalDate from supplied data.
|
java.time.LocalDateTime |
decodeLocalDateTime(byte[] data)
Decode LocalDateTime from supplied data.
|
java.time.LocalTime |
decodeLocalTime(byte[] data)
Decode LocalTime from supplied data.
|
long |
decodeLong(byte[] byte_int)
Decode a
byte array into a long value. |
short |
decodeShort(byte[] byte_int)
Decode a
byte array into a short value. |
short |
decodeShort(byte[] bytes,
int fromIndex)
Decode from a
byte array to a short value. |
java.lang.String |
decodeString(byte[] value)
Decode an encoded
byte array into a String using the encoding of this datatype coder. |
java.sql.Time |
decodeTime(java.sql.Time d,
java.util.Calendar cal,
boolean invertTimeZone)
Deprecated.
will be removed in Jaybird 6
|
java.sql.Time |
decodeTimeCalendar(byte[] int_byte,
java.util.Calendar c)
Deprecated.
use
decodeLocalTime(byte[]); will be removed in Jaybird 6 |
DatatypeCoder.RawDateTimeStruct |
decodeTimeRaw(byte[] int_byte)
Deprecated.
use
decodeLocalTime(byte[]); will be removed in Jaybird 6 |
java.sql.Timestamp |
decodeTimestamp(java.sql.Timestamp value,
java.util.Calendar cal,
boolean invertTimeZone)
Deprecated.
will be removed in Jaybird 6
|
java.sql.Timestamp |
decodeTimestampCalendar(byte[] byte_long,
java.util.Calendar c)
Deprecated.
use
decodeLocalDateTime(byte[]); will be removed in Jaybird 6 |
DatatypeCoder.RawDateTimeStruct |
decodeTimestampRaw(byte[] byte_long)
Deprecated.
use
decodeLocalDateTime(byte[]); will be removed in Jaybird 6 |
byte[] |
encodeBoolean(boolean value)
Encodes boolean to 1 byte data.
|
java.sql.Date |
encodeDate(java.sql.Date d,
java.util.Calendar cal)
Deprecated.
will be removed in Jaybird 6
|
byte[] |
encodeDateCalendar(java.sql.Date d,
java.util.Calendar c)
Deprecated.
use
encodeLocalDate(LocalDate); will be removed in Jaybird 6 |
byte[] |
encodeDateRaw(DatatypeCoder.RawDateTimeStruct raw)
Deprecated.
use
encodeLocalDate(LocalDate); will be removed in Jaybird 6 |
byte[] |
encodeDecimal128(Decimal128 decimal128)
Encodes a decimal128 to a byte array.
|
byte[] |
encodeDecimal64(Decimal64 decimal64)
Encodes a decimal64 to a byte array.
|
byte[] |
encodeDouble(double value)
Encode a
double value as a byte array. |
byte[] |
encodeFloat(float value)
Encode a
float value as a byte array. |
byte[] |
encodeInt(int value)
Encode an
int value as a byte array. |
void |
encodeInt(int value,
byte[] target,
int fromIndex)
Encode an
int value into the target byte array starting at index fromIndex. |
byte[] |
encodeInt128(java.math.BigInteger bigInteger)
Encodes a BigInteger to a 16-byte byte array.
|
byte[] |
encodeLocalDate(java.time.LocalDate value)
Encodes a java.time.LocalDate to date bytes.
|
byte[] |
encodeLocalDateTime(java.time.LocalDateTime value)
Encodes a java.time.LocalDateTime to timestamp bytes.
|
byte[] |
encodeLocalTime(java.time.LocalTime value)
Encodes a java.time.LocalTime to time bytes.
|
byte[] |
encodeLong(long value)
Encode a
long value as a byte array. |
byte[] |
encodeShort(int value)
Encode a
short value as a byte array. |
void |
encodeShort(int value,
byte[] target,
int fromIndex)
Encode a
short value into the target byte array starting at index fromIndex. |
byte[] |
encodeShort(short value)
Encode a
short value as a byte array. |
byte[] |
encodeString(java.lang.String value)
Encode a
String value into a byte array using the encoding of this datatype coder. |
java.sql.Time |
encodeTime(java.sql.Time d,
java.util.Calendar cal,
boolean invertTimeZone)
Deprecated.
use
encodeLocalTime(LocalTime); will be removed in Jaybird 6 |
byte[] |
encodeTimeCalendar(java.sql.Time d,
java.util.Calendar c)
Deprecated.
will be removed in Jaybird 6
|
byte[] |
encodeTimeRaw(DatatypeCoder.RawDateTimeStruct raw)
Deprecated.
use
encodeLocalTime(LocalTime); will be removed in Jaybird 6 |
java.sql.Timestamp |
encodeTimestamp(java.sql.Timestamp value,
java.util.Calendar cal,
boolean invertTimeZone)
Deprecated.
will be removed in Jaybird 6
|
byte[] |
encodeTimestampCalendar(java.sql.Timestamp value,
java.util.Calendar c)
Deprecated.
use
encodeLocalDateTime(LocalDateTime); will be removed in Jaybird 6 |
byte[] |
encodeTimestampRaw(DatatypeCoder.RawDateTimeStruct raw)
Deprecated.
use
encodeLocalDateTime(LocalDateTime); will be removed in Jaybird 6 |
boolean |
equals(java.lang.Object other) |
DatatypeCoder |
forEncodingDefinition(EncodingDefinition encodingDefinition)
Return a derived datatype coder that applies the supplied encoding definition for string conversions.
|
Encoding |
getEncoding() |
EncodingDefinition |
getEncodingDefinition() |
IEncodingFactory |
getEncodingFactory() |
int |
hashCode() |
int |
sizeOfShort()
The size of an encoded short in this data type coder.
|
DatatypeCoder |
unwrap()
Unwrap this datatype coder to its parent (or itself).
|
static final int NANOSECONDS_PER_FRACTION
static final int FRACTIONS_PER_MILLISECOND
static final int FRACTIONS_PER_SECOND
static final int FRACTIONS_PER_MINUTE
static final int FRACTIONS_PER_HOUR
int sizeOfShort()
2 or 4 bytes)byte[] encodeShort(short value)
short value as a byte array.value - The value to be encodedvalue encoded as a byte arrayencodeShort(int)byte[] encodeShort(int value)
short value as a byte array.value - The value to be encodedvalue encoded as a byte arrayvoid encodeShort(int value,
byte[] target,
int fromIndex)
short value into the target byte array starting at index fromIndex.value - The value to be encodedtarget - Target byte array of sufficient size (warning: this may be datatype coder specific)fromIndex - Index to start writingshort decodeShort(byte[] byte_int)
byte array into a short value.byte_int - The byte array to be decodedshort value of the decoded byte arrayshort decodeShort(byte[] bytes,
int fromIndex)
byte array to a short value.bytes - The byte array to be decodedfromIndex - The index to start readingshort value of the decoded byte arraybyte[] encodeInt(int value)
int value as a byte array.value - The value to be encodedvalue encoded as a byte arrayvoid encodeInt(int value,
byte[] target,
int fromIndex)
int value into the target byte array starting at index fromIndex.value - The value to be encodedtarget - Target byte array of sufficient sizefromIndex - Index to start writingint decodeInt(byte[] byte_int)
byte array into an int value.byte_int - The byte array to be decodedint value of the decoded byte arrayint decodeInt(byte[] bytes,
int fromIndex)
byte array to an int value.bytes - The byte array to be decodedfromIndex - The index to start readingint value of the decoded byte arraybyte[] encodeLong(long value)
long value as a byte array.value - The value to be encodedvalue encoded as a byte arraylong decodeLong(byte[] byte_int)
byte array into a long value.byte_int - The byte array to be decodedlong value of the decoded byte arraybyte[] encodeFloat(float value)
float value as a byte array.value - The value to be encodedvalue encoded as a byte arrayfloat decodeFloat(byte[] byte_int)
byte array into a float value.byte_int - The byte array to be decodedfloat value of the decoded byte arraybyte[] encodeDouble(double value)
double value as a byte array.value - The value to be encodedvalue encoded as a byte arraydouble decodeDouble(byte[] byte_int)
byte array into a double value.byte_int - The byte array to be decodeddouble value of the decoded byte arraybyte[] encodeString(java.lang.String value)
String value into a byte array using the encoding of this datatype coder.value - The String to be encodedvalue as a byte arrayjava.io.Writer createWriter(java.io.OutputStream outputStream)
outputStream - Input streamjava.lang.String decodeString(byte[] value)
byte array into a String using the encoding of this datatype coder.value - The value to be decodedStringjava.io.Reader createReader(java.io.InputStream inputStream)
inputStream - Input stream@Deprecated
java.sql.Timestamp encodeTimestamp(java.sql.Timestamp value,
java.util.Calendar cal,
boolean invertTimeZone)
Timestamp using a given Calendar.value - The Timestamp to be encodedcal - The Calendar to be used for encoding,
may be nullinvertTimeZone - If true, the timezone offset value
will be subtracted from the encoded value, otherwise it will
be addedTimestamp@Deprecated byte[] encodeTimestampRaw(DatatypeCoder.RawDateTimeStruct raw)
encodeLocalDateTime(LocalDateTime); will be removed in Jaybird 6byte array.raw - The RawDateTimeStruct to be encodedbytes representing the date and time of the given RawDateTimeStruct@Deprecated
byte[] encodeTimestampCalendar(java.sql.Timestamp value,
java.util.Calendar c)
encodeLocalDateTime(LocalDateTime); will be removed in Jaybird 6Timestamp as a byte array.value - The Timestamp to be encodedc - Calendar to use for time zone calculationbytes that represents the given Timestamp value@Deprecated
java.sql.Timestamp decodeTimestamp(java.sql.Timestamp value,
java.util.Calendar cal,
boolean invertTimeZone)
Timestamp value using a given Calendar.value - The Timestamp to be decodedcal - The Calendar to be used in decoding,
may be nullinvertTimeZone - If true, the timezone offset value
will be subtracted from the decoded value, otherwise it will
be addedTimestamp@Deprecated DatatypeCoder.RawDateTimeStruct decodeTimestampRaw(byte[] byte_long)
decodeLocalDateTime(byte[]); will be removed in Jaybird 6byte array into a raw date time struct.byte_long - The byte array to be decodedDatatypeCoder.RawDateTimeStruct.@Deprecated
java.sql.Timestamp decodeTimestampCalendar(byte[] byte_long,
java.util.Calendar c)
decodeLocalDateTime(byte[]); will be removed in Jaybird 6byte array into a Timestamp.byte_long - The byte array to be decodedc - Calendar to use for time zone calculationTimestamp value from the decoded bytes@Deprecated
java.sql.Time encodeTime(java.sql.Time d,
java.util.Calendar cal,
boolean invertTimeZone)
encodeLocalTime(LocalTime); will be removed in Jaybird 6Time value using a given Calendar.d - The Time to be encodedcal - The Calendar to be used in the encoding, may be nullTime@Deprecated byte[] encodeTimeRaw(DatatypeCoder.RawDateTimeStruct raw)
encodeLocalTime(LocalTime); will be removed in Jaybird 6byte array.raw - The RawDateTimeStruct to be encodedbytes representing the time of the given RawDateTimeStruct@Deprecated
byte[] encodeTimeCalendar(java.sql.Time d,
java.util.Calendar c)
Time value into a byte array.d - The Time to be encodedc - Calendar to use for time zone calculationbytes representing the given Time@Deprecated
java.sql.Time decodeTime(java.sql.Time d,
java.util.Calendar cal,
boolean invertTimeZone)
Time value using a given Calendar.d - The Time to be decodedcal - The Calendar to be used in the decoding, may be nullTime@Deprecated DatatypeCoder.RawDateTimeStruct decodeTimeRaw(byte[] int_byte)
decodeLocalTime(byte[]); will be removed in Jaybird 6byte array into a raw date time struct.int_byte - The byte array to be decodedDatatypeCoder.RawDateTimeStruct@Deprecated
java.sql.Time decodeTimeCalendar(byte[] int_byte,
java.util.Calendar c)
decodeLocalTime(byte[]); will be removed in Jaybird 6byte array into a Time value.int_byte - The byte array to be decodedc - Calendar to use for time zone calculationTime@Deprecated
java.sql.Date encodeDate(java.sql.Date d,
java.util.Calendar cal)
Date value using a given Calendar.d - The Date to be encodedcal - The Calendar to be used in the encoding, may be nullDate@Deprecated byte[] encodeDateRaw(DatatypeCoder.RawDateTimeStruct raw)
encodeLocalDate(LocalDate); will be removed in Jaybird 6byte array.raw - The RawDateTimeStruct to be encodedbytes representing the date of the given RawDateTimeStruct@Deprecated
byte[] encodeDateCalendar(java.sql.Date d,
java.util.Calendar c)
encodeLocalDate(LocalDate); will be removed in Jaybird 6Date value into a byte array.d - The Date to be encodedc - Calendar to use for time zone calculationbytes representing the given Date@Deprecated
java.sql.Date decodeDate(java.sql.Date d,
java.util.Calendar cal)
Date value using a given Calendar.d - The Date to be decodedcal - The Calendar to be used in the decoding, may be nullDate@Deprecated DatatypeCoder.RawDateTimeStruct decodeDateRaw(byte[] byte_int)
decodeLocalDate(byte[]); will be removed in Jaybird 6byte array into a raw date time struct.byte_int - The byte array to be decodedDatatypeCoder.RawDateTimeStruct@Deprecated
java.sql.Date decodeDateCalendar(byte[] byte_int,
java.util.Calendar c)
decodeLocalDate(byte[]); will be removed in Jaybird 6byte array into a Date value.byte_int - The byte array to be decodedc - Calendar to use for time zone calculationDateboolean decodeBoolean(byte[] data)
data - (expected) 1 bytesfalse when 0, true for all other valuesbyte[] encodeBoolean(boolean value)
value - Boolean value to encodetrue as 1, false as 0.java.time.LocalTime decodeLocalTime(byte[] data)
data - (expected) 4 bytesbyte[] encodeLocalTime(java.time.LocalTime value)
value - LocalTime value to encodejava.time.LocalDate decodeLocalDate(byte[] data)
data - (expected) 4 bytesbyte[] encodeLocalDate(java.time.LocalDate value)
value - LocalDate to encodejava.time.LocalDateTime decodeLocalDateTime(byte[] data)
data - (expected) 8 bytesbyte[] encodeLocalDateTime(java.time.LocalDateTime value)
value - LocalDateTime to encodeDecimal64 decodeDecimal64(byte[] data)
data - Data to decode (expected 8 bytes)byte[] encodeDecimal64(Decimal64 decimal64)
decimal64 - The decimal64 value to be encodedDecimal128 decodeDecimal128(byte[] data)
data - Data to decode (expected 16 bytes)byte[] encodeDecimal128(Decimal128 decimal128)
decimal128 - The decimal128 value to be encodedjava.math.BigInteger decodeInt128(byte[] data)
data - Data to decode (expected 16 bytes)byte[] encodeInt128(java.math.BigInteger bigInteger)
The implementation expects to be passed a value that fits in 16 bytes. If a larger value is passed, and
IllegalArgumentException is thrown.
bigInteger - The BigInteger value to be encodedIEncodingFactory getEncodingFactory()
EncodingDefinition getEncodingDefinition()
Encoding getEncoding()
DatatypeCoder forEncodingDefinition(EncodingDefinition encodingDefinition)
encodingDefinition - Encoding definitionDatatypeCoder unwrap()
boolean equals(java.lang.Object other)
Equality: same basic type (ie: wire protocol/JNA type + endianness) and same encoding definition.
This does not need to take into account the encoding factory, as usage should be limited to datatype coders derived from the same connection.
equals in class java.lang.Objectother - Object to compare totrue if other is an equivalent datatype coder.int hashCode()
hashCode in class java.lang.ObjectCopyright © 2001-2024 Jaybird (Firebird JDBC) team. All rights reserved.