Class ByteWrangler


  • public class ByteWrangler
    extends Object
    This class contains all the byte shifting
    Author:
    Victor Toni
    • Field Detail

      • MAX_VALUE_LENGTH

        public static final int MAX_VALUE_LENGTH
        Maximum number of bytes a value can consist of.
        See Also:
        Constant Field Values
      • MAX_DATA_LENGTH

        public static final int MAX_DATA_LENGTH
        Maximum number of bytes record data can consist of. It is MAX_VALUE_LENGTH + 1 because the first byte contains the number of the following bytes.
        See Also:
        Constant Field Values
      • NO_VALUE

        public static final byte[] NO_VALUE
        Representation of no value. A zero length array of bytes.
      • EMPTY_TXT

        public static final byte[] EMPTY_TXT
        Representation of empty text. The first byte denotes the length of the following character bytes (in this case zero.) FIXME: Should this be exported as a method since it could change externally???
      • CHARSET_NAME

        public static final String CHARSET_NAME
        Name for charset used to convert Strings to/from wire bytes: "UTF-8".
        See Also:
        Constant Field Values
    • Constructor Detail

      • ByteWrangler

        public ByteWrangler()
    • Method Detail

      • readUTF

        public static String readUTF​(byte[] data)
        Read data bytes as "UTF-8" to String.
      • readUTF

        public static String readUTF​(byte[] data,
                                     int off,
                                     int len)
        Read data bytes as "UTF-8" to String.
      • readProperties

        public static void readProperties​(Map<String,​byte[]> properties,
                                          byte[] textBytes)
                                   throws Exception
        Throws:
        Exception
      • textFromProperties

        public static byte[] textFromProperties​(Map<String,​?> props)