public class UnicodeCharInterpreter extends CharInterpreter
Binary interpreter for the type "unicodeChar" of VOTable.
arraySeparator, arraySizeInterpreter, fixArraySizes, NB_BYTES, nbItems, strNullValue, TYPE_LABEL
Constructor and Description |
---|
UnicodeCharInterpreter(int[] arraysizes) |
Modifier and Type | Method and Description |
---|---|
java.lang.Character |
decodePrimary(byte[] b,
int offset)
Decodes only one data of type T from the given bytes array.
|
byte[] |
encodePrimary(java.lang.Character value)
Encodes a single value of type T in binary.
|
convertPrimary, getArrayClass
arraySizeToString, convertIntoArray, convertToString, createEmptyArray, createInterpreter, decode, encode, getArraySize, getPadding, getPadding, readBytes
public UnicodeCharInterpreter(int[] arraysizes) throws BinaryInterpreterException
BinaryInterpreterException
public java.lang.Character decodePrimary(byte[] b, int offset) throws BinaryInterpreterException
BinaryFieldInterpreter
Decodes only one data of type T from the given bytes array.
WARNING: bytes
is supposed to contain enough bytes (>= BinaryFieldInterpreter.NB_BYTES
) from the given offset.
decodePrimary
in class CharInterpreter
b
- Array to use to extract enough bytes so that decoding one data of type T.offset
- Position from which bytes must be read.BinaryInterpreterException
- If an error occurs while decoding bytes.public byte[] encodePrimary(java.lang.Character value) throws BinaryInterpreterException
BinaryFieldInterpreter
Encodes a single value of type T in binary.
NOTE: If the given value is null, BinaryFieldInterpreter.getPadding()
will be returned.
encodePrimary
in class CharInterpreter
value
- The value to encode. (MAY BE NULL).BinaryInterpreterException
- If there is an error while encoding the given value.