From d479253768d296a40b4f699e1de9b03c7146a97a Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Tue, 3 Dec 2013 14:03:28 -0800 Subject: Adding javadocs and Carbonado User Guide --- apidocs/com/amazon/carbonado/raw/DataDecoder.html | 879 ++++++++++++++++++++++ 1 file changed, 879 insertions(+) create mode 100644 apidocs/com/amazon/carbonado/raw/DataDecoder.html (limited to 'apidocs/com/amazon/carbonado/raw/DataDecoder.html') diff --git a/apidocs/com/amazon/carbonado/raw/DataDecoder.html b/apidocs/com/amazon/carbonado/raw/DataDecoder.html new file mode 100644 index 0000000..d9c7e29 --- /dev/null +++ b/apidocs/com/amazon/carbonado/raw/DataDecoder.html @@ -0,0 +1,879 @@ + + + + + + +DataDecoder (Carbonado 1.2.3 API) + + + + + + + +
+ + + + + +
+ + + +
+
com.amazon.carbonado.raw
+

Class DataDecoder

+
+
+ +
+
    +
  • +
    +
    +
    public class DataDecoder
    +extends java.lang.Object
    +
    A very low-level class that decodes key components encoded by methods of + DataEncoder.
    +
    Author:
    +
    Brian S O'Neill
    +
    See Also:
    KeyDecoder
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Summary

      + + + + + + + + +
      Constructors 
      Constructor and Description
      DataDecoder() 
      +
    • +
    + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods 
      Modifier and TypeMethod and Description
      static intdecode(byte[] src, + int srcOffset, + java.math.BigDecimal[] valueRef) +
      Decodes a BigDecimal.
      +
      static intdecode(byte[] src, + int srcOffset, + java.math.BigInteger[] valueRef) +
      Decodes a BigInteger.
      +
      static intdecode(byte[] src, + int srcOffset, + byte[][] valueRef) +
      Decodes the given byte array.
      +
      static booleandecodeBoolean(byte[] src, + int srcOffset) +
      Decodes a boolean from exactly 1 byte.
      +
      static java.lang.BooleandecodeBooleanObj(byte[] src, + int srcOffset) +
      Decodes a Boolean object from exactly 1 byte.
      +
      static bytedecodeByte(byte[] src, + int srcOffset) +
      Decodes a signed byte from exactly 1 byte.
      +
      static java.lang.BytedecodeByteObj(byte[] src, + int srcOffset) +
      Decodes a signed Byte object from exactly 1 or 2 bytes.
      +
      static chardecodeChar(byte[] src, + int srcOffset) +
      Decodes a char from exactly 2 bytes.
      +
      static java.lang.CharacterdecodeCharacterObj(byte[] src, + int srcOffset) +
      Decodes a Character object from exactly 1 or 3 bytes.
      +
      static doubledecodeDouble(byte[] src, + int srcOffset) +
      Decodes a double from exactly 8 bytes.
      +
      protected static longdecodeDoubleBits(byte[] src, + int srcOffset) 
      static java.lang.DoubledecodeDoubleObj(byte[] src, + int srcOffset) +
      Decodes a Double object from exactly 8 bytes.
      +
      static floatdecodeFloat(byte[] src, + int srcOffset) +
      Decodes a float from exactly 4 bytes.
      +
      protected static intdecodeFloatBits(byte[] src, + int srcOffset) 
      static java.lang.FloatdecodeFloatObj(byte[] src, + int srcOffset) +
      Decodes a Float object from exactly 4 bytes.
      +
      static intdecodeInt(byte[] src, + int srcOffset) +
      Decodes a signed integer from exactly 4 bytes.
      +
      static java.lang.IntegerdecodeIntegerObj(byte[] src, + int srcOffset) +
      Decodes a signed Integer object from exactly 1 or 5 bytes.
      +
      static longdecodeLong(byte[] src, + int srcOffset) +
      Decodes a signed long from exactly 8 bytes.
      +
      static java.lang.LongdecodeLongObj(byte[] src, + int srcOffset) +
      Decodes a signed Long object from exactly 1 or 9 bytes.
      +
      static shortdecodeShort(byte[] src, + int srcOffset) +
      Decodes a signed short from exactly 2 bytes.
      +
      static java.lang.ShortdecodeShortObj(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 intdecodeString(byte[] src, + int srcOffset, + java.lang.String[] valueRef) +
      Decodes an encoded string from the given byte array.
      +
      static voidreadFully(java.io.InputStream in, + byte[] b) +
      Reads as many bytes from the stream as is necessary to fill the given + byte array.
      +
      static intreadLength(java.io.InputStream in) +
      Decodes a length value which was encoded by DataEncoder.writeLength(int, java.io.OutputStream).
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        DataDecoder

        +
        public DataDecoder()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        decodeInt

        +
        public static int decodeInt(byte[] src,
        +            int srcOffset)
        +                     throws CorruptEncodingException
        +
        Decodes a signed integer from exactly 4 bytes.
        +
        Parameters:
        src - source of encoded bytes
        srcOffset - offset into source array
        +
        Returns:
        signed integer value
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + +
        +
      • +

        decodeIntegerObj

        +
        public static java.lang.Integer decodeIntegerObj(byte[] src,
        +                                 int srcOffset)
        +                                          throws CorruptEncodingException
        +
        Decodes a signed Integer object from exactly 1 or 5 bytes. If null is + returned, then 1 byte was read.
        +
        Parameters:
        src - source of encoded bytes
        srcOffset - offset into source array
        +
        Returns:
        signed Integer object or null
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + +
        +
      • +

        decodeLong

        +
        public static long decodeLong(byte[] src,
        +              int srcOffset)
        +                       throws CorruptEncodingException
        +
        Decodes a signed long from exactly 8 bytes.
        +
        Parameters:
        src - source of encoded bytes
        srcOffset - offset into source array
        +
        Returns:
        signed long value
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + +
        +
      • +

        decodeLongObj

        +
        public static java.lang.Long decodeLongObj(byte[] src,
        +                           int srcOffset)
        +                                    throws CorruptEncodingException
        +
        Decodes a signed Long object from exactly 1 or 9 bytes. If null is + returned, then 1 byte was read.
        +
        Parameters:
        src - source of encoded bytes
        srcOffset - offset into source array
        +
        Returns:
        signed Long object or null
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + +
        +
      • +

        decodeByte

        +
        public static byte decodeByte(byte[] src,
        +              int srcOffset)
        +                       throws CorruptEncodingException
        +
        Decodes a signed byte from exactly 1 byte.
        +
        Parameters:
        src - source of encoded bytes
        srcOffset - offset into source array
        +
        Returns:
        signed byte value
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + +
        +
      • +

        decodeByteObj

        +
        public static java.lang.Byte decodeByteObj(byte[] src,
        +                           int srcOffset)
        +                                    throws CorruptEncodingException
        +
        Decodes a signed Byte object from exactly 1 or 2 bytes. If null is + returned, then 1 byte was read.
        +
        Parameters:
        src - source of encoded bytes
        srcOffset - offset into source array
        +
        Returns:
        signed Byte object or null
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + +
        +
      • +

        decodeShort

        +
        public static short decodeShort(byte[] src,
        +                int srcOffset)
        +                         throws CorruptEncodingException
        +
        Decodes a signed short from exactly 2 bytes.
        +
        Parameters:
        src - source of encoded bytes
        srcOffset - offset into source array
        +
        Returns:
        signed short value
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + +
        +
      • +

        decodeShortObj

        +
        public static java.lang.Short decodeShortObj(byte[] src,
        +                             int srcOffset)
        +                                      throws CorruptEncodingException
        +
        Decodes a signed Short object from exactly 1 or 3 bytes. If null is + returned, then 1 byte was read.
        +
        Parameters:
        src - source of encoded bytes
        srcOffset - offset into source array
        +
        Returns:
        signed Short object or null
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + +
        +
      • +

        decodeChar

        +
        public static char decodeChar(byte[] src,
        +              int srcOffset)
        +                       throws CorruptEncodingException
        +
        Decodes a char from exactly 2 bytes.
        +
        Parameters:
        src - source of encoded bytes
        srcOffset - offset into source array
        +
        Returns:
        char value
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + +
        +
      • +

        decodeCharacterObj

        +
        public static java.lang.Character decodeCharacterObj(byte[] src,
        +                                     int srcOffset)
        +                                              throws CorruptEncodingException
        +
        Decodes a Character object from exactly 1 or 3 bytes. If null is + returned, then 1 byte was read.
        +
        Parameters:
        src - source of encoded bytes
        srcOffset - offset into source array
        +
        Returns:
        Character object or null
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + +
        +
      • +

        decodeBoolean

        +
        public static boolean decodeBoolean(byte[] src,
        +                    int srcOffset)
        +                             throws CorruptEncodingException
        +
        Decodes a boolean from exactly 1 byte.
        +
        Parameters:
        src - source of encoded bytes
        srcOffset - offset into source array
        +
        Returns:
        boolean value
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + +
        +
      • +

        decodeBooleanObj

        +
        public static java.lang.Boolean decodeBooleanObj(byte[] src,
        +                                 int srcOffset)
        +                                          throws CorruptEncodingException
        +
        Decodes a Boolean object from exactly 1 byte.
        +
        Parameters:
        src - source of encoded bytes
        srcOffset - offset into source array
        +
        Returns:
        Boolean object or null
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + +
        +
      • +

        decodeFloat

        +
        public static float decodeFloat(byte[] src,
        +                int srcOffset)
        +                         throws CorruptEncodingException
        +
        Decodes a float from exactly 4 bytes.
        +
        Parameters:
        src - source of encoded bytes
        srcOffset - offset into source array
        +
        Returns:
        float value
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + +
        +
      • +

        decodeFloatObj

        +
        public static java.lang.Float decodeFloatObj(byte[] src,
        +                             int srcOffset)
        +                                      throws CorruptEncodingException
        +
        Decodes a Float object from exactly 4 bytes.
        +
        Parameters:
        src - source of encoded bytes
        srcOffset - offset into source array
        +
        Returns:
        Float object or null
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + + + + + +
        +
      • +

        decodeDouble

        +
        public static double decodeDouble(byte[] src,
        +                  int srcOffset)
        +                           throws CorruptEncodingException
        +
        Decodes a double from exactly 8 bytes.
        +
        Parameters:
        src - source of encoded bytes
        srcOffset - offset into source array
        +
        Returns:
        double value
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + +
        +
      • +

        decodeDoubleObj

        +
        public static java.lang.Double decodeDoubleObj(byte[] src,
        +                               int srcOffset)
        +                                        throws CorruptEncodingException
        +
        Decodes a Double object from exactly 8 bytes.
        +
        Parameters:
        src - source of encoded bytes
        srcOffset - offset into source array
        +
        Returns:
        Double object or null
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + + + + + +
        +
      • +

        decode

        +
        public static int decode(byte[] src,
        +         int srcOffset,
        +         java.math.BigInteger[] valueRef)
        +                  throws CorruptEncodingException
        +
        Decodes a BigInteger.
        +
        Parameters:
        src - source of encoded data
        srcOffset - offset into encoded data
        valueRef - decoded BigInteger is stored in element 0, which may be null
        +
        Returns:
        amount of bytes read from source
        +
        Throws:
        +
        CorruptEncodingException - if source data is corrupt
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        decode

        +
        public static int decode(byte[] src,
        +         int srcOffset,
        +         java.math.BigDecimal[] valueRef)
        +                  throws CorruptEncodingException
        +
        Decodes a BigDecimal.
        +
        Parameters:
        src - source of encoded data
        srcOffset - offset into encoded data
        valueRef - decoded BigDecimal is stored in element 0, which may be null
        +
        Returns:
        amount of bytes read from source
        +
        Throws:
        +
        CorruptEncodingException - if source data is corrupt
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        decode

        +
        public static int decode(byte[] src,
        +         int srcOffset,
        +         byte[][] valueRef)
        +                  throws CorruptEncodingException
        +
        Decodes the given byte array.
        +
        Parameters:
        src - source of encoded data
        srcOffset - offset into encoded data
        valueRef - decoded byte array is stored in element 0, which may be null
        +
        Returns:
        amount of bytes read from source
        +
        Throws:
        +
        CorruptEncodingException - if source data is corrupt
        +
      • +
      + + + +
        +
      • +

        decodeString

        +
        public static int decodeString(byte[] src,
        +               int srcOffset,
        +               java.lang.String[] valueRef)
        +                        throws CorruptEncodingException
        +
        Decodes an encoded string from the given byte array.
        +
        Parameters:
        src - source of encoded data
        srcOffset - offset into encoded data
        valueRef - decoded string is stored in element 0, which may be null
        +
        Returns:
        amount of bytes read from source
        +
        Throws:
        +
        CorruptEncodingException - if source data is corrupt
        +
      • +
      + + + +
        +
      • +

        readLength

        +
        public static int readLength(java.io.InputStream in)
        +                      throws java.io.IOException,
        +                             java.io.EOFException
        +
        Decodes a length value which was encoded by DataEncoder.writeLength(int, java.io.OutputStream).
        +
        Returns:
        length value
        +
        Throws:
        +
        java.io.IOException
        +
        java.io.EOFException
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        readFully

        +
        public static void readFully(java.io.InputStream in,
        +             byte[] b)
        +                      throws java.io.IOException,
        +                             java.io.EOFException
        +
        Reads as many bytes from the stream as is necessary to fill the given + byte array. An EOFException is thrown if the stream end is encountered.
        +
        Throws:
        +
        java.io.IOException
        +
        java.io.EOFException
        Since:
        +
        1.2
        +
      • +
      + + + +
        +
      • +

        decodeSingle

        +
        public static byte[] decodeSingle(byte[] src,
        +                  int prefixPadding,
        +                  int suffixPadding)
        +                           throws CorruptEncodingException
        +
        Decodes the given byte array which was encoded by DataEncoder.encodeSingle(byte[], int, int). Always returns a new byte array instance.
        +
        Parameters:
        prefixPadding - amount of extra bytes to skip from start of encoded byte array
        suffixPadding - amount of extra bytes to skip at end of encoded byte array
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      + + + + + + + +
        +
      • +

        decodeSingleNullable

        +
        public static byte[] decodeSingleNullable(byte[] src,
        +                          int prefixPadding,
        +                          int suffixPadding)
        +                                   throws CorruptEncodingException
        +
        Decodes the given byte array which was encoded by DataEncoder.encodeSingleNullable(byte[]). Always returns a new byte array + instance.
        +
        Parameters:
        prefixPadding - amount of extra bytes to skip from start of encoded byte array
        suffixPadding - amount of extra bytes to skip at end of encoded byte array
        +
        Throws:
        +
        CorruptEncodingException
        +
      • +
      +
    • +
    +
  • +
+
+
+ + +
+ + + + + +
+ + +

Copyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.

+ + -- cgit v1.2.3