Enum BinaryEncoding
- All Implemented Interfaces:
Serializable
,Comparable<BinaryEncoding>
,java.lang.constant.Constable
The way binary data are encoded in a table column.
- Since:
- 1.2
- Version:
- 1.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
An input stream which converts hexadecimal string on-the-fly.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe bytes returned by the JDBC driver are encoded as hexadecimal numbers.The bytes returned by the JDBC driver in a query are directly the binary data. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecode
(InputStream source) Returns an input stream decoding bytes on-the-fly.byte[]
Returns the value in the specified column as an array of decoded bytes.static BinaryEncoding
Returns the enum constant of this type with the specified name.static BinaryEncoding[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
RAW
The bytes returned by the JDBC driver in a query are directly the binary data. -
HEXADECIMAL
The bytes returned by the JDBC driver are encoded as hexadecimal numbers.
-
-
Constructor Details
-
BinaryEncoding
private BinaryEncoding()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getBytes
Returns the value in the specified column as an array of decoded bytes. If the bytes returned by the JDBC driver are encoded, this method decode them.- Parameters:
results
- the result set from which to get the values.columnIndex
- column from which to get the values.- Returns:
- the column values, or
null
if none. - Throws:
SQLException
- if an error occurred while fetching column values.- See Also:
-
decode
Returns an input stream decoding bytes on-the-fly.- Parameters:
source
- the stream of data in their encoded format.- Returns:
- a stream of decoded bytes.
- See Also:
-