public class DataDecoder
extends java.lang.Object
DataEncoder.KeyDecoder| Constructor and Description |
|---|
DataDecoder() |
| Modifier and Type | Method and Description |
|---|---|
static int |
decode(byte[] src,
int srcOffset,
java.math.BigDecimal[] valueRef)
Decodes a BigDecimal.
|
static int |
decode(byte[] src,
int srcOffset,
java.math.BigInteger[] valueRef)
Decodes a BigInteger.
|
static int |
decode(byte[] src,
int srcOffset,
byte[][] valueRef)
Decodes the given byte array.
|
static boolean |
decodeBoolean(byte[] src,
int srcOffset)
Decodes a boolean from exactly 1 byte.
|
static java.lang.Boolean |
decodeBooleanObj(byte[] src,
int srcOffset)
Decodes a Boolean object from exactly 1 byte.
|
static byte |
decodeByte(byte[] src,
int srcOffset)
Decodes a signed byte from exactly 1 byte.
|
static java.lang.Byte |
decodeByteObj(byte[] src,
int srcOffset)
Decodes a signed Byte object from exactly 1 or 2 bytes.
|
static char |
decodeChar(byte[] src,
int srcOffset)
Decodes a char from exactly 2 bytes.
|
static java.lang.Character |
decodeCharacterObj(byte[] src,
int srcOffset)
Decodes a Character object from exactly 1 or 3 bytes.
|
static double |
decodeDouble(byte[] src,
int srcOffset)
Decodes a double from exactly 8 bytes.
|
protected static long |
decodeDoubleBits(byte[] src,
int srcOffset) |
static java.lang.Double |
decodeDoubleObj(byte[] src,
int srcOffset)
Decodes a Double object from exactly 8 bytes.
|
static float |
decodeFloat(byte[] src,
int srcOffset)
Decodes a float from exactly 4 bytes.
|
protected static int |
decodeFloatBits(byte[] src,
int srcOffset) |
static java.lang.Float |
decodeFloatObj(byte[] src,
int srcOffset)
Decodes a Float object from exactly 4 bytes.
|
static int |
decodeInt(byte[] src,
int srcOffset)
Decodes a signed integer from exactly 4 bytes.
|
static java.lang.Integer |
decodeIntegerObj(byte[] src,
int srcOffset)
Decodes a signed Integer object from exactly 1 or 5 bytes.
|
static long |
decodeLong(byte[] src,
int srcOffset)
Decodes a signed long from exactly 8 bytes.
|
static java.lang.Long |
decodeLongObj(byte[] src,
int srcOffset)
Decodes a signed Long object from exactly 1 or 9 bytes.
|
static short |
decodeShort(byte[] src,
int srcOffset)
Decodes a signed short from exactly 2 bytes.
|
static java.lang.Short |
decodeShortObj(byte[] src,
int srcOffset)
Decodes a signed Short object from exactly 1 or 3 bytes.
|
static byte[] |
decodeSingle(byte[] src,
int prefixPadding,
int suffixPadding)
Decodes the given byte array which was encoded by
DataEncoder.encodeSingle(byte[], int, int). |
static byte[] |
decodeSingleNullable(byte[] src)
Decodes the given byte array which was encoded by
DataEncoder.encodeSingleNullable(byte[]). |
static byte[] |
decodeSingleNullable(byte[] src,
int prefixPadding,
int suffixPadding)
Decodes the given byte array which was encoded by
DataEncoder.encodeSingleNullable(byte[]). |
static int |
decodeString(byte[] src,
int srcOffset,
java.lang.String[] valueRef)
Decodes an encoded string from the given byte array.
|
static void |
readFully(java.io.InputStream in,
byte[] b)
Reads as many bytes from the stream as is necessary to fill the given
byte array.
|
static int |
readLength(java.io.InputStream in)
Decodes a length value which was encoded by
DataEncoder.writeLength(int, java.io.OutputStream). |
public static int decodeInt(byte[] src,
int srcOffset)
throws CorruptEncodingException
src - source of encoded bytessrcOffset - offset into source arrayCorruptEncodingExceptionpublic static java.lang.Integer decodeIntegerObj(byte[] src,
int srcOffset)
throws CorruptEncodingException
src - source of encoded bytessrcOffset - offset into source arrayCorruptEncodingExceptionpublic static long decodeLong(byte[] src,
int srcOffset)
throws CorruptEncodingException
src - source of encoded bytessrcOffset - offset into source arrayCorruptEncodingExceptionpublic static java.lang.Long decodeLongObj(byte[] src,
int srcOffset)
throws CorruptEncodingException
src - source of encoded bytessrcOffset - offset into source arrayCorruptEncodingExceptionpublic static byte decodeByte(byte[] src,
int srcOffset)
throws CorruptEncodingException
src - source of encoded bytessrcOffset - offset into source arrayCorruptEncodingExceptionpublic static java.lang.Byte decodeByteObj(byte[] src,
int srcOffset)
throws CorruptEncodingException
src - source of encoded bytessrcOffset - offset into source arrayCorruptEncodingExceptionpublic static short decodeShort(byte[] src,
int srcOffset)
throws CorruptEncodingException
src - source of encoded bytessrcOffset - offset into source arrayCorruptEncodingExceptionpublic static java.lang.Short decodeShortObj(byte[] src,
int srcOffset)
throws CorruptEncodingException
src - source of encoded bytessrcOffset - offset into source arrayCorruptEncodingExceptionpublic static char decodeChar(byte[] src,
int srcOffset)
throws CorruptEncodingException
src - source of encoded bytessrcOffset - offset into source arrayCorruptEncodingExceptionpublic static java.lang.Character decodeCharacterObj(byte[] src,
int srcOffset)
throws CorruptEncodingException
src - source of encoded bytessrcOffset - offset into source arrayCorruptEncodingExceptionpublic static boolean decodeBoolean(byte[] src,
int srcOffset)
throws CorruptEncodingException
src - source of encoded bytessrcOffset - offset into source arrayCorruptEncodingExceptionpublic static java.lang.Boolean decodeBooleanObj(byte[] src,
int srcOffset)
throws CorruptEncodingException
src - source of encoded bytessrcOffset - offset into source arrayCorruptEncodingExceptionpublic static float decodeFloat(byte[] src,
int srcOffset)
throws CorruptEncodingException
src - source of encoded bytessrcOffset - offset into source arrayCorruptEncodingExceptionpublic static java.lang.Float decodeFloatObj(byte[] src,
int srcOffset)
throws CorruptEncodingException
src - source of encoded bytessrcOffset - offset into source arrayCorruptEncodingExceptionprotected static int decodeFloatBits(byte[] src,
int srcOffset)
throws CorruptEncodingException
CorruptEncodingExceptionpublic static double decodeDouble(byte[] src,
int srcOffset)
throws CorruptEncodingException
src - source of encoded bytessrcOffset - offset into source arrayCorruptEncodingExceptionpublic static java.lang.Double decodeDoubleObj(byte[] src,
int srcOffset)
throws CorruptEncodingException
src - source of encoded bytessrcOffset - offset into source arrayCorruptEncodingExceptionprotected static long decodeDoubleBits(byte[] src,
int srcOffset)
throws CorruptEncodingException
CorruptEncodingExceptionpublic static int decode(byte[] src,
int srcOffset,
java.math.BigInteger[] valueRef)
throws CorruptEncodingException
src - source of encoded datasrcOffset - offset into encoded datavalueRef - decoded BigInteger is stored in element 0, which may be nullCorruptEncodingException - if source data is corruptpublic static int decode(byte[] src,
int srcOffset,
java.math.BigDecimal[] valueRef)
throws CorruptEncodingException
src - source of encoded datasrcOffset - offset into encoded datavalueRef - decoded BigDecimal is stored in element 0, which may be nullCorruptEncodingException - if source data is corruptpublic static int decode(byte[] src,
int srcOffset,
byte[][] valueRef)
throws CorruptEncodingException
src - source of encoded datasrcOffset - offset into encoded datavalueRef - decoded byte array is stored in element 0, which may be nullCorruptEncodingException - if source data is corruptpublic static int decodeString(byte[] src,
int srcOffset,
java.lang.String[] valueRef)
throws CorruptEncodingException
src - source of encoded datasrcOffset - offset into encoded datavalueRef - decoded string is stored in element 0, which may be nullCorruptEncodingException - if source data is corruptpublic static int readLength(java.io.InputStream in)
throws java.io.IOException,
java.io.EOFException
DataEncoder.writeLength(int, java.io.OutputStream).java.io.IOExceptionjava.io.EOFExceptionpublic static void readFully(java.io.InputStream in,
byte[] b)
throws java.io.IOException,
java.io.EOFException
java.io.IOExceptionjava.io.EOFExceptionpublic static byte[] decodeSingle(byte[] src,
int prefixPadding,
int suffixPadding)
throws CorruptEncodingException
DataEncoder.encodeSingle(byte[], int, int). Always returns a new byte array instance.prefixPadding - amount of extra bytes to skip from start of encoded byte arraysuffixPadding - amount of extra bytes to skip at end of encoded byte arrayCorruptEncodingExceptionpublic static byte[] decodeSingleNullable(byte[] src)
throws CorruptEncodingException
DataEncoder.encodeSingleNullable(byte[]). Always returns a new byte array
instance.CorruptEncodingExceptionpublic static byte[] decodeSingleNullable(byte[] src,
int prefixPadding,
int suffixPadding)
throws CorruptEncodingException
DataEncoder.encodeSingleNullable(byte[]). Always returns a new byte array
instance.prefixPadding - amount of extra bytes to skip from start of encoded byte arraysuffixPadding - amount of extra bytes to skip at end of encoded byte arrayCorruptEncodingExceptionCopyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.