Conversion
Date: 2017-02-08

org.apache.commons.lang3

## Class Conversion

- java.lang.Object
- - org.apache.commons.lang3.Conversion

-     public class Conversion
      extends java.lang.Object

  Static methods to convert a type into another, with endianness and bit ordering awareness.

  The methods names follow a naming rule:
  `<source type>[source endianness][source bit ordering]To<destination type>[destination endianness][destination bit ordering]`

  Source/destination type fields is one of the following:

  - binary: an array of booleans
  - byte or byteArray
  - int or intArray
  - long or longArray
  - hex: a String containing hexadecimal digits (lowercase in destination)
  - hexDigit: a Char containing a hexadecimal digit (lowercase in destination)
  - uuid

  Endianness field: little endian is the default, in this case the field is absent. In case of big endian, the field is "Be".
  Bit ordering: Lsb0 is the default, in this case the field is absent. In case of Msb0, the field is "Msb0".

  Example: intBeMsb0ToHex convert an int with big endian byte order and Msb0 bit order into its hexadecimal string representation

  Most of the methods provide only default encoding for destination, this limits the number of ways to do one thing. Unless you are dealing with data from/to outside of the JVM platform, you should not need to use "Be" and "Msb0" methods.

  Development status: work on going, only a part of the little endian, Lsb0 methods implemented so far.

  Since:
    Lang 3.2

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Conversion()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static char` | `binaryBeMsb0ToHexDigit(boolean[] src)` Converts the first 4 bits of a binary (represented as boolean array) in big endian Msb0 bit ordering to a hexadecimal digit.
    `static char` | `binaryBeMsb0ToHexDigit(boolean[] src, int srcPos)` Converts a binary (represented as boolean array) in big endian Msb0 bit ordering to a hexadecimal digit.
    `static byte` | `binaryToByte(boolean[] src, int srcPos, byte dstInit, int dstPos, int nBools)` Converts binary (represented as boolean array) into a byte using the default (little endian, Lsb0) byte and bit ordering.
    `static char` | `binaryToHexDigit(boolean[] src)` Converts binary (represented as boolean array) to a hexadecimal digit using the default (Lsb0) bit ordering.
    `static char` | `binaryToHexDigit(boolean[] src, int srcPos)` Converts binary (represented as boolean array) to a hexadecimal digit using the default (Lsb0) bit ordering.
    `static char` | `binaryToHexDigitMsb0_4bits(boolean[] src)` Converts binary (represented as boolean array) to a hexadecimal digit using the Msb0 bit ordering.
    `static char` | `binaryToHexDigitMsb0_4bits(boolean[] src, int srcPos)` Converts binary (represented as boolean array) to a hexadecimal digit using the Msb0 bit ordering.
    `static int` | `binaryToInt(boolean[] src, int srcPos, int dstInit, int dstPos, int nBools)` Converts binary (represented as boolean array) into a int using the default (little endian, Lsb0) byte and bit ordering.
    `static long` | `binaryToLong(boolean[] src, int srcPos, long dstInit, int dstPos, int nBools)` Converts binary (represented as boolean array) into a long using the default (little endian, Lsb0) byte and bit ordering.
    `static short` | `binaryToShort(boolean[] src, int srcPos, short dstInit, int dstPos, int nBools)` Converts binary (represented as boolean array) into a short using the default (little endian, Lsb0) byte and bit ordering.
    `static int` | `byteArrayToInt(byte[] src, int srcPos, int dstInit, int dstPos, int nBytes)` Converts an array of byte into a int using the default (little endian, Lsb0) byte and bit ordering.
    `static long` | `byteArrayToLong(byte[] src, int srcPos, long dstInit, int dstPos, int nBytes)` Converts an array of byte into a long using the default (little endian, Lsb0) byte and bit ordering.
    `static short` | `byteArrayToShort(byte[] src, int srcPos, short dstInit, int dstPos, int nBytes)` Converts an array of byte into a short using the default (little endian, Lsb0) byte and bit ordering.
    `static java.util.UUID` | `byteArrayToUuid(byte[] src, int srcPos)` Converts bytes from an array into a UUID using the default (little endian, Lsb0) byte and bit ordering.
    `static boolean[]` | `byteToBinary(byte src, int srcPos, boolean[] dst, int dstPos, int nBools)` Converts a byte into an array of boolean using the default (little endian, Lsb0) byte and bit ordering.
    `static java.lang.String` | `byteToHex(byte src, int srcPos, java.lang.String dstInit, int dstPos, int nHexs)` Converts a byte into an array of Char using the default (little endian, Lsb0) byte and bit ordering.
    `static boolean[]` | `hexDigitMsb0ToBinary(char hexDigit)` Converts a hexadecimal digit into binary (represented as boolean array) using the Msb0 bit ordering.
    `static int` | `hexDigitMsb0ToInt(char hexDigit)` Converts a hexadecimal digit into an int using the Msb0 bit ordering.
    `static boolean[]` | `hexDigitToBinary(char hexDigit)` Converts a hexadecimal digit into binary (represented as boolean array) using the default (Lsb0) bit ordering.
    `static int` | `hexDigitToInt(char hexDigit)` Converts a hexadecimal digit into an int using the default (Lsb0) bit ordering.
    `static byte` | `hexToByte(java.lang.String src, int srcPos, byte dstInit, int dstPos, int nHex)` Converts an array of Char into a byte using the default (little endian, Lsb0) byte and bit ordering.
    `static int` | `hexToInt(java.lang.String src, int srcPos, int dstInit, int dstPos, int nHex)` Converts an array of Char into a int using the default (little endian, Lsb0) byte and bit ordering.
    `static long` | `hexToLong(java.lang.String src, int srcPos, long dstInit, int dstPos, int nHex)` Converts an array of Char into a long using the default (little endian, Lsb0) byte and bit ordering.
    `static short` | `hexToShort(java.lang.String src, int srcPos, short dstInit, int dstPos, int nHex)` Converts an array of Char into a short using the default (little endian, Lsb0) byte and bit ordering.
    `static long` | `intArrayToLong(int[] src, int srcPos, long dstInit, int dstPos, int nInts)` Converts an array of int into a long using the default (little endian, Lsb0) byte and bit ordering.
    `static boolean[]` | `intToBinary(int src, int srcPos, boolean[] dst, int dstPos, int nBools)` Converts a int into an array of boolean using the default (little endian, Lsb0) byte and bit ordering.
    `static byte[]` | `intToByteArray(int src, int srcPos, byte[] dst, int dstPos, int nBytes)` Converts a int into an array of byte using the default (little endian, Lsb0) byte and bit ordering.
    `static java.lang.String` | `intToHex(int src, int srcPos, java.lang.String dstInit, int dstPos, int nHexs)` Converts a int into an array of Char using the default (little endian, Lsb0) byte and bit ordering.
    `static char` | `intToHexDigit(int nibble)` Converts the 4 lsb of an int to a hexadecimal digit.
    `static char` | `intToHexDigitMsb0(int nibble)` Converts the 4 lsb of an int to a hexadecimal digit encoded using the Msb0 bit ordering.
    `static short[]` | `intToShortArray(int src, int srcPos, short[] dst, int dstPos, int nShorts)` Converts a int into an array of short using the default (little endian, Lsb0) byte and bit ordering.
    `static boolean[]` | `longToBinary(long src, int srcPos, boolean[] dst, int dstPos, int nBools)` Converts a long into an array of boolean using the default (little endian, Lsb0) byte and bit ordering.
    `static byte[]` | `longToByteArray(long src, int srcPos, byte[] dst, int dstPos, int nBytes)` Converts a long into an array of byte using the default (little endian, Lsb0) byte and bit ordering.
    `static java.lang.String` | `longToHex(long src, int srcPos, java.lang.String dstInit, int dstPos, int nHexs)` Converts a long into an array of Char using the default (little endian, Lsb0) byte and bit ordering.
    `static int[]` | `longToIntArray(long src, int srcPos, int[] dst, int dstPos, int nInts)` Converts a long into an array of int using the default (little endian, Lsb0) byte and bit ordering.
    `static short[]` | `longToShortArray(long src, int srcPos, short[] dst, int dstPos, int nShorts)` Converts a long into an array of short using the default (little endian, Lsb0) byte and bit ordering.
    `static int` | `shortArrayToInt(short[] src, int srcPos, int dstInit, int dstPos, int nShorts)` Converts an array of short into a int using the default (little endian, Lsb0) byte and bit ordering.
    `static long` | `shortArrayToLong(short[] src, int srcPos, long dstInit, int dstPos, int nShorts)` Converts an array of short into a long using the default (little endian, Lsb0) byte and bit ordering.
    `static boolean[]` | `shortToBinary(short src, int srcPos, boolean[] dst, int dstPos, int nBools)` Converts a short into an array of boolean using the default (little endian, Lsb0) byte and bit ordering.
    `static byte[]` | `shortToByteArray(short src, int srcPos, byte[] dst, int dstPos, int nBytes)` Converts a short into an array of byte using the default (little endian, Lsb0) byte and bit ordering.
    `static java.lang.String` | `shortToHex(short src, int srcPos, java.lang.String dstInit, int dstPos, int nHexs)` Converts a short into an array of Char using the default (little endian, Lsb0) byte and bit ordering.
    `static byte[]` | `uuidToByteArray(java.util.UUID src, byte[] dst, int dstPos, int nBytes)` Converts UUID into an array of byte using the default (little endian, Lsb0) byte and bit ordering.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Conversion

          public Conversion()

  - ### Method Detail

    - #### hexDigitToInt

          public static int hexDigitToInt(char hexDigit)

      Converts a hexadecimal digit into an int using the default (Lsb0) bit ordering.

      '1' is converted to 1

      Parameters:
        `hexDigit` - the hexadecimal digit to convert
      Returns:
        an int equals to `hexDigit`
      Throws:
        `java.lang.IllegalArgumentException` - if `hexDigit` is not a hexadecimal digit

    - #### hexDigitMsb0ToInt

          public static int hexDigitMsb0ToInt(char hexDigit)

      Converts a hexadecimal digit into an int using the Msb0 bit ordering.

      '1' is converted to 8

      Parameters:
        `hexDigit` - the hexadecimal digit to convert
      Returns:
        an int equals to `hexDigit`
      Throws:
        `java.lang.IllegalArgumentException` - if `hexDigit` is not a hexadecimal digit

    - #### hexDigitToBinary

          public static boolean[] hexDigitToBinary(char hexDigit)

      Converts a hexadecimal digit into binary (represented as boolean array) using the default (Lsb0) bit ordering.

      '1' is converted as follow: (1, 0, 0, 0)

      Parameters:
        `hexDigit` - the hexadecimal digit to convert
      Returns:
        a boolean array with the binary representation of `hexDigit`
      Throws:
        `java.lang.IllegalArgumentException` - if `hexDigit` is not a hexadecimal digit

    - #### hexDigitMsb0ToBinary

          public static boolean[] hexDigitMsb0ToBinary(char hexDigit)

      Converts a hexadecimal digit into binary (represented as boolean array) using the Msb0 bit ordering.

      '1' is converted as follow: (0, 0, 0, 1)

      Parameters:
        `hexDigit` - the hexadecimal digit to convert
      Returns:
        a boolean array with the binary representation of `hexDigit`
      Throws:
        `java.lang.IllegalArgumentException` - if `hexDigit` is not a hexadecimal digit

    - #### binaryToHexDigit

          public static char binaryToHexDigit(boolean[] src)

      Converts binary (represented as boolean array) to a hexadecimal digit using the default (Lsb0) bit ordering.

      (1, 0, 0, 0) is converted as follow: '1'

      Parameters:
        `src` - the binary to convert
      Returns:
        a hexadecimal digit representing the selected bits
      Throws:
        `java.lang.IllegalArgumentException` - if `src` is empty
        `java.lang.NullPointerException` - if `src` is `null`

    - #### binaryToHexDigit

          public static char binaryToHexDigit(boolean[] src,
                              int srcPos)

      Converts binary (represented as boolean array) to a hexadecimal digit using the default (Lsb0) bit ordering.

      (1, 0, 0, 0) is converted as follow: '1'

      Parameters:
        `src` - the binary to convert
        `srcPos` - the position of the lsb to start the conversion
      Returns:
        a hexadecimal digit representing the selected bits
      Throws:
        `java.lang.IllegalArgumentException` - if `src` is empty
        `java.lang.NullPointerException` - if `src` is `null`

    - #### binaryToHexDigitMsb0_4bits

          public static char binaryToHexDigitMsb0_4bits(boolean[] src)

      Converts binary (represented as boolean array) to a hexadecimal digit using the Msb0 bit ordering.

      (1, 0, 0, 0) is converted as follow: '8'

      Parameters:
        `src` - the binary to convert
      Returns:
        a hexadecimal digit representing the selected bits
      Throws:
        `java.lang.IllegalArgumentException` - if `src` is empty, `src.length < 4` or `src.length > 8`
        `java.lang.NullPointerException` - if `src` is `null`

    - #### binaryToHexDigitMsb0_4bits

          public static char binaryToHexDigitMsb0_4bits(boolean[] src,
                                        int srcPos)

      Converts binary (represented as boolean array) to a hexadecimal digit using the Msb0 bit ordering.

      (1, 0, 0, 0) is converted as follow: '8' (1,0,0,1,1,0,1,0) with srcPos = 3 is converted to 'D'

      Parameters:
        `src` - the binary to convert
        `srcPos` - the position of the lsb to start the conversion
      Returns:
        a hexadecimal digit representing the selected bits
      Throws:
        `java.lang.IllegalArgumentException` - if `src` is empty, `src.length > 8` or `src.length - srcPos < 4`
        `java.lang.NullPointerException` - if `src` is `null`

    - #### binaryBeMsb0ToHexDigit

          public static char binaryBeMsb0ToHexDigit(boolean[] src)

      Converts the first 4 bits of a binary (represented as boolean array) in big endian Msb0 bit ordering to a hexadecimal digit.

      (1, 0, 0, 0) is converted as follow: '8' (1,0,0,0,0,0,0,0, 0,0,0,0,0,1,0,0) is converted to '4'

      Parameters:
        `src` - the binary to convert
      Returns:
        a hexadecimal digit representing the selected bits
      Throws:
        `java.lang.IllegalArgumentException` - if `src` is empty
        `java.lang.NullPointerException` - if `src` is `null`

    - #### binaryBeMsb0ToHexDigit

          public static char binaryBeMsb0ToHexDigit(boolean[] src,
                                    int srcPos)

      Converts a binary (represented as boolean array) in big endian Msb0 bit ordering to a hexadecimal digit.

      (1, 0, 0, 0) with srcPos = 0 is converted as follow: '8' (1,0,0,0,0,0,0,0, 0,0,0,1,0,1,0,0) with srcPos = 2 is converted to '5'

      Parameters:
        `src` - the binary to convert
        `srcPos` - the position of the lsb to start the conversion
      Returns:
        a hexadecimal digit representing the selected bits
      Throws:
        `java.lang.IllegalArgumentException` - if `src` is empty
        `java.lang.NullPointerException` - if `src` is `null`

    - #### intToHexDigit

          public static char intToHexDigit(int nibble)

      Converts the 4 lsb of an int to a hexadecimal digit.

      0 returns '0'

      1 returns '1'

      10 returns 'A' and so on...

      Parameters:
        `nibble` - the 4 bits to convert
      Returns:
        a hexadecimal digit representing the 4 lsb of `nibble`
      Throws:
        `java.lang.IllegalArgumentException` - if `nibble < 0` or `nibble > 15`

    - #### intToHexDigitMsb0

          public static char intToHexDigitMsb0(int nibble)

      Converts the 4 lsb of an int to a hexadecimal digit encoded using the Msb0 bit ordering.

      0 returns '0'

      1 returns '8'

      10 returns '5' and so on...

      Parameters:
        `nibble` - the 4 bits to convert
      Returns:
        a hexadecimal digit representing the 4 lsb of `nibble`
      Throws:
        `java.lang.IllegalArgumentException` - if `nibble < 0` or `nibble > 15`

    - #### intArrayToLong

          public static long intArrayToLong(int[] src,
                            int srcPos,
                            long dstInit,
                            int dstPos,
                            int nInts)

      Converts an array of int into a long using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the int array to convert
        `srcPos` - the position in `src`, in int unit, from where to start the conversion
        `dstInit` - initial value of the destination long
        `dstPos` - the position of the lsb, in bits, in the result long
        `nInts` - the number of ints to convert
      Returns:
        a long containing the selected bits
      Throws:
        `java.lang.IllegalArgumentException` - if `(nInts-1)*32+dstPos >= 64`
        `java.lang.NullPointerException` - if `src` is `null`
        `java.lang.ArrayIndexOutOfBoundsException` - if `srcPos + nInts > src.length`

    - #### shortArrayToLong

          public static long shortArrayToLong(short[] src,
                              int srcPos,
                              long dstInit,
                              int dstPos,
                              int nShorts)

      Converts an array of short into a long using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the short array to convert
        `srcPos` - the position in `src`, in short unit, from where to start the conversion
        `dstInit` - initial value of the destination long
        `dstPos` - the position of the lsb, in bits, in the result long
        `nShorts` - the number of shorts to convert
      Returns:
        a long containing the selected bits
      Throws:
        `java.lang.NullPointerException` - if `src` is `null`
        `java.lang.IllegalArgumentException` - if `(nShorts-1)*16+dstPos >= 64`
        `java.lang.ArrayIndexOutOfBoundsException` - if `srcPos + nShorts > src.length`

    - #### shortArrayToInt

          public static int shortArrayToInt(short[] src,
                            int srcPos,
                            int dstInit,
                            int dstPos,
                            int nShorts)

      Converts an array of short into a int using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the short array to convert
        `srcPos` - the position in `src`, in short unit, from where to start the conversion
        `dstInit` - initial value of the destination int
        `dstPos` - the position of the lsb, in bits, in the result int
        `nShorts` - the number of shorts to convert
      Returns:
        a int containing the selected bits
      Throws:
        `java.lang.NullPointerException` - if `src` is `null`
        `java.lang.IllegalArgumentException` - if `(nShorts-1)*16+dstPos >= 32`
        `java.lang.ArrayIndexOutOfBoundsException` - if `srcPos + nShorts > src.length`

    - #### byteArrayToLong

          public static long byteArrayToLong(byte[] src,
                             int srcPos,
                             long dstInit,
                             int dstPos,
                             int nBytes)

      Converts an array of byte into a long using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the byte array to convert
        `srcPos` - the position in `src`, in byte unit, from where to start the conversion
        `dstInit` - initial value of the destination long
        `dstPos` - the position of the lsb, in bits, in the result long
        `nBytes` - the number of bytes to convert
      Returns:
        a long containing the selected bits
      Throws:
        `java.lang.NullPointerException` - if `src` is `null`
        `java.lang.IllegalArgumentException` - if `(nBytes-1)*8+dstPos >= 64`
        `java.lang.ArrayIndexOutOfBoundsException` - if `srcPos + nBytes > src.length`

    - #### byteArrayToInt

          public static int byteArrayToInt(byte[] src,
                           int srcPos,
                           int dstInit,
                           int dstPos,
                           int nBytes)

      Converts an array of byte into a int using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the byte array to convert
        `srcPos` - the position in `src`, in byte unit, from where to start the conversion
        `dstInit` - initial value of the destination int
        `dstPos` - the position of the lsb, in bits, in the result int
        `nBytes` - the number of bytes to convert
      Returns:
        a int containing the selected bits
      Throws:
        `java.lang.NullPointerException` - if `src` is `null`
        `java.lang.IllegalArgumentException` - if `(nBytes-1)*8+dstPos >= 32`
        `java.lang.ArrayIndexOutOfBoundsException` - if `srcPos + nBytes > src.length`

    - #### byteArrayToShort

          public static short byteArrayToShort(byte[] src,
                               int srcPos,
                               short dstInit,
                               int dstPos,
                               int nBytes)

      Converts an array of byte into a short using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the byte array to convert
        `srcPos` - the position in `src`, in byte unit, from where to start the conversion
        `dstInit` - initial value of the destination short
        `dstPos` - the position of the lsb, in bits, in the result short
        `nBytes` - the number of bytes to convert
      Returns:
        a short containing the selected bits
      Throws:
        `java.lang.NullPointerException` - if `src` is `null`
        `java.lang.IllegalArgumentException` - if `(nBytes-1)*8+dstPos >= 16`
        `java.lang.ArrayIndexOutOfBoundsException` - if `srcPos + nBytes > src.length`

    - #### hexToLong

          public static long hexToLong(java.lang.String src,
                       int srcPos,
                       long dstInit,
                       int dstPos,
                       int nHex)

      Converts an array of Char into a long using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the hex string to convert
        `srcPos` - the position in `src`, in Char unit, from where to start the conversion
        `dstInit` - initial value of the destination long
        `dstPos` - the position of the lsb, in bits, in the result long
        `nHex` - the number of Chars to convert
      Returns:
        a long containing the selected bits
      Throws:
        `java.lang.IllegalArgumentException` - if `(nHexs-1)*4+dstPos >= 64`

    - #### hexToInt

          public static int hexToInt(java.lang.String src,
                     int srcPos,
                     int dstInit,
                     int dstPos,
                     int nHex)

      Converts an array of Char into a int using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the hex string to convert
        `srcPos` - the position in `src`, in Char unit, from where to start the conversion
        `dstInit` - initial value of the destination int
        `dstPos` - the position of the lsb, in bits, in the result int
        `nHex` - the number of Chars to convert
      Returns:
        a int containing the selected bits
      Throws:
        `java.lang.IllegalArgumentException` - if `(nHexs-1)*4+dstPos >= 32`

    - #### hexToShort

          public static short hexToShort(java.lang.String src,
                         int srcPos,
                         short dstInit,
                         int dstPos,
                         int nHex)

      Converts an array of Char into a short using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the hex string to convert
        `srcPos` - the position in `src`, in Char unit, from where to start the conversion
        `dstInit` - initial value of the destination short
        `dstPos` - the position of the lsb, in bits, in the result short
        `nHex` - the number of Chars to convert
      Returns:
        a short containing the selected bits
      Throws:
        `java.lang.IllegalArgumentException` - if `(nHexs-1)*4+dstPos >= 16`

    - #### hexToByte

          public static byte hexToByte(java.lang.String src,
                       int srcPos,
                       byte dstInit,
                       int dstPos,
                       int nHex)

      Converts an array of Char into a byte using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the hex string to convert
        `srcPos` - the position in `src`, in Char unit, from where to start the conversion
        `dstInit` - initial value of the destination byte
        `dstPos` - the position of the lsb, in bits, in the result byte
        `nHex` - the number of Chars to convert
      Returns:
        a byte containing the selected bits
      Throws:
        `java.lang.IllegalArgumentException` - if `(nHexs-1)*4+dstPos >= 8`

    - #### binaryToLong

          public static long binaryToLong(boolean[] src,
                          int srcPos,
                          long dstInit,
                          int dstPos,
                          int nBools)

      Converts binary (represented as boolean array) into a long using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the binary to convert
        `srcPos` - the position in `src`, in boolean unit, from where to start the conversion
        `dstInit` - initial value of the destination long
        `dstPos` - the position of the lsb, in bits, in the result long
        `nBools` - the number of booleans to convert
      Returns:
        a long containing the selected bits
      Throws:
        `java.lang.NullPointerException` - if `src` is `null`
        `java.lang.IllegalArgumentException` - if `nBools-1+dstPos >= 64`
        `java.lang.ArrayIndexOutOfBoundsException` - if `srcPos + nBools > src.length`

    - #### binaryToInt

          public static int binaryToInt(boolean[] src,
                        int srcPos,
                        int dstInit,
                        int dstPos,
                        int nBools)

      Converts binary (represented as boolean array) into a int using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the binary to convert
        `srcPos` - the position in `src`, in boolean unit, from where to start the conversion
        `dstInit` - initial value of the destination int
        `dstPos` - the position of the lsb, in bits, in the result int
        `nBools` - the number of booleans to convert
      Returns:
        a int containing the selected bits
      Throws:
        `java.lang.NullPointerException` - if `src` is `null`
        `java.lang.IllegalArgumentException` - if `nBools-1+dstPos >= 32`
        `java.lang.ArrayIndexOutOfBoundsException` - if `srcPos + nBools > src.length`

    - #### binaryToShort

          public static short binaryToShort(boolean[] src,
                            int srcPos,
                            short dstInit,
                            int dstPos,
                            int nBools)

      Converts binary (represented as boolean array) into a short using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the binary to convert
        `srcPos` - the position in `src`, in boolean unit, from where to start the conversion
        `dstInit` - initial value of the destination short
        `dstPos` - the position of the lsb, in bits, in the result short
        `nBools` - the number of booleans to convert
      Returns:
        a short containing the selected bits
      Throws:
        `java.lang.NullPointerException` - if `src` is `null`
        `java.lang.IllegalArgumentException` - if `nBools-1+dstPos >= 16`
        `java.lang.ArrayIndexOutOfBoundsException` - if `srcPos + nBools > src.length`

    - #### binaryToByte

          public static byte binaryToByte(boolean[] src,
                          int srcPos,
                          byte dstInit,
                          int dstPos,
                          int nBools)

      Converts binary (represented as boolean array) into a byte using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the binary to convert
        `srcPos` - the position in `src`, in boolean unit, from where to start the conversion
        `dstInit` - initial value of the destination byte
        `dstPos` - the position of the lsb, in bits, in the result byte
        `nBools` - the number of booleans to convert
      Returns:
        a byte containing the selected bits
      Throws:
        `java.lang.NullPointerException` - if `src` is `null`
        `java.lang.IllegalArgumentException` - if `nBools-1+dstPos >= 8`
        `java.lang.ArrayIndexOutOfBoundsException` - if `srcPos + nBools > src.length`

    - #### longToIntArray

          public static int[] longToIntArray(long src,
                             int srcPos,
                             int[] dst,
                             int dstPos,
                             int nInts)

      Converts a long into an array of int using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the long to convert
        `srcPos` - the position in `src`, in bits, from where to start the conversion
        `dst` - the destination array
        `dstPos` - the position in `dst` where to copy the result
        `nInts` - the number of ints to copy to `dst`, must be smaller or equal to the width of the input (from srcPos to msb)
      Returns:
        `dst`
      Throws:
        `java.lang.NullPointerException` - if `dst` is `null` and `nInts > 0`
        `java.lang.IllegalArgumentException` - if `(nInts-1)*32+srcPos >= 64`
        `java.lang.ArrayIndexOutOfBoundsException` - if `dstPos + nInts > dst.length`

    - #### longToShortArray

          public static short[] longToShortArray(long src,
                                 int srcPos,
                                 short[] dst,
                                 int dstPos,
                                 int nShorts)

      Converts a long into an array of short using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the long to convert
        `srcPos` - the position in `src`, in bits, from where to start the conversion
        `dst` - the destination array
        `dstPos` - the position in `dst` where to copy the result
        `nShorts` - the number of shorts to copy to `dst`, must be smaller or equal to the width of the input (from srcPos to msb)
      Returns:
        `dst`
      Throws:
        `java.lang.NullPointerException` - if `dst` is `null`
        `java.lang.IllegalArgumentException` - if `(nShorts-1)*16+srcPos >= 64`
        `java.lang.ArrayIndexOutOfBoundsException` - if `dstPos + nShorts > dst.length`

    - #### intToShortArray

          public static short[] intToShortArray(int src,
                                int srcPos,
                                short[] dst,
                                int dstPos,
                                int nShorts)

      Converts a int into an array of short using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the int to convert
        `srcPos` - the position in `src`, in bits, from where to start the conversion
        `dst` - the destination array
        `dstPos` - the position in `dst` where to copy the result
        `nShorts` - the number of shorts to copy to `dst`, must be smaller or equal to the width of the input (from srcPos to msb)
      Returns:
        `dst`
      Throws:
        `java.lang.NullPointerException` - if `dst` is `null`
        `java.lang.IllegalArgumentException` - if `(nShorts-1)*16+srcPos >= 32`
        `java.lang.ArrayIndexOutOfBoundsException` - if `dstPos + nShorts > dst.length`

    - #### longToByteArray

          public static byte[] longToByteArray(long src,
                               int srcPos,
                               byte[] dst,
                               int dstPos,
                               int nBytes)

      Converts a long into an array of byte using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the long to convert
        `srcPos` - the position in `src`, in bits, from where to start the conversion
        `dst` - the destination array
        `dstPos` - the position in `dst` where to copy the result
        `nBytes` - the number of bytes to copy to `dst`, must be smaller or equal to the width of the input (from srcPos to msb)
      Returns:
        `dst`
      Throws:
        `java.lang.NullPointerException` - if `dst` is `null`
        `java.lang.IllegalArgumentException` - if `(nBytes-1)*8+srcPos >= 64`
        `java.lang.ArrayIndexOutOfBoundsException` - if `dstPos + nBytes > dst.length`

    - #### intToByteArray

          public static byte[] intToByteArray(int src,
                              int srcPos,
                              byte[] dst,
                              int dstPos,
                              int nBytes)

      Converts a int into an array of byte using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the int to convert
        `srcPos` - the position in `src`, in bits, from where to start the conversion
        `dst` - the destination array
        `dstPos` - the position in `dst` where to copy the result
        `nBytes` - the number of bytes to copy to `dst`, must be smaller or equal to the width of the input (from srcPos to msb)
      Returns:
        `dst`
      Throws:
        `java.lang.NullPointerException` - if `dst` is `null`
        `java.lang.IllegalArgumentException` - if `(nBytes-1)*8+srcPos >= 32`
        `java.lang.ArrayIndexOutOfBoundsException` - if `dstPos + nBytes > dst.length`

    - #### shortToByteArray

          public static byte[] shortToByteArray(short src,
                                int srcPos,
                                byte[] dst,
                                int dstPos,
                                int nBytes)

      Converts a short into an array of byte using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the short to convert
        `srcPos` - the position in `src`, in bits, from where to start the conversion
        `dst` - the destination array
        `dstPos` - the position in `dst` where to copy the result
        `nBytes` - the number of bytes to copy to `dst`, must be smaller or equal to the width of the input (from srcPos to msb)
      Returns:
        `dst`
      Throws:
        `java.lang.NullPointerException` - if `dst` is `null`
        `java.lang.IllegalArgumentException` - if `(nBytes-1)*8+srcPos >= 16`
        `java.lang.ArrayIndexOutOfBoundsException` - if `dstPos + nBytes > dst.length`

    - #### longToHex

          public static java.lang.String longToHex(long src,
                                   int srcPos,
                                   java.lang.String dstInit,
                                   int dstPos,
                                   int nHexs)

      Converts a long into an array of Char using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the long to convert
        `srcPos` - the position in `src`, in bits, from where to start the conversion
        `dstInit` - the initial value for the result String
        `dstPos` - the position in `dst` where to copy the result
        `nHexs` - the number of Chars to copy to `dst`, must be smaller or equal to the width of the input (from srcPos to msb)
      Returns:
        `dst`
      Throws:
        `java.lang.IllegalArgumentException` - if `(nHexs-1)*4+srcPos >= 64`
        `java.lang.StringIndexOutOfBoundsException` - if `dst.init.length() < dstPos`

    - #### intToHex

          public static java.lang.String intToHex(int src,
                                  int srcPos,
                                  java.lang.String dstInit,
                                  int dstPos,
                                  int nHexs)

      Converts a int into an array of Char using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the int to convert
        `srcPos` - the position in `src`, in bits, from where to start the conversion
        `dstInit` - the initial value for the result String
        `dstPos` - the position in `dst` where to copy the result
        `nHexs` - the number of Chars to copy to `dst`, must be smaller or equal to the width of the input (from srcPos to msb)
      Returns:
        `dst`
      Throws:
        `java.lang.IllegalArgumentException` - if `(nHexs-1)*4+srcPos >= 32`
        `java.lang.StringIndexOutOfBoundsException` - if `dst.init.length() < dstPos`

    - #### shortToHex

          public static java.lang.String shortToHex(short src,
                                    int srcPos,
                                    java.lang.String dstInit,
                                    int dstPos,
                                    int nHexs)

      Converts a short into an array of Char using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the short to convert
        `srcPos` - the position in `src`, in bits, from where to start the conversion
        `dstInit` - the initial value for the result String
        `dstPos` - the position in `dst` where to copy the result
        `nHexs` - the number of Chars to copy to `dst`, must be smaller or equal to the width of the input (from srcPos to msb)
      Returns:
        `dst`
      Throws:
        `java.lang.IllegalArgumentException` - if `(nHexs-1)*4+srcPos >= 16`
        `java.lang.StringIndexOutOfBoundsException` - if `dst.init.length() < dstPos`

    - #### byteToHex

          public static java.lang.String byteToHex(byte src,
                                   int srcPos,
                                   java.lang.String dstInit,
                                   int dstPos,
                                   int nHexs)

      Converts a byte into an array of Char using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the byte to convert
        `srcPos` - the position in `src`, in bits, from where to start the conversion
        `dstInit` - the initial value for the result String
        `dstPos` - the position in `dst` where to copy the result
        `nHexs` - the number of Chars to copy to `dst`, must be smaller or equal to the width of the input (from srcPos to msb)
      Returns:
        `dst`
      Throws:
        `java.lang.IllegalArgumentException` - if `(nHexs-1)*4+srcPos >= 8`
        `java.lang.StringIndexOutOfBoundsException` - if `dst.init.length() < dstPos`

    - #### longToBinary

          public static boolean[] longToBinary(long src,
                               int srcPos,
                               boolean[] dst,
                               int dstPos,
                               int nBools)

      Converts a long into an array of boolean using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the long to convert
        `srcPos` - the position in `src`, in bits, from where to start the conversion
        `dst` - the destination array
        `dstPos` - the position in `dst` where to copy the result
        `nBools` - the number of booleans to copy to `dst`, must be smaller or equal to the width of the input (from srcPos to msb)
      Returns:
        `dst`
      Throws:
        `java.lang.NullPointerException` - if `dst` is `null`
        `java.lang.IllegalArgumentException` - if `nBools-1+srcPos >= 64`
        `java.lang.ArrayIndexOutOfBoundsException` - if `dstPos + nBools > dst.length`

    - #### intToBinary

          public static boolean[] intToBinary(int src,
                              int srcPos,
                              boolean[] dst,
                              int dstPos,
                              int nBools)

      Converts a int into an array of boolean using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the int to convert
        `srcPos` - the position in `src`, in bits, from where to start the conversion
        `dst` - the destination array
        `dstPos` - the position in `dst` where to copy the result
        `nBools` - the number of booleans to copy to `dst`, must be smaller or equal to the width of the input (from srcPos to msb)
      Returns:
        `dst`
      Throws:
        `java.lang.NullPointerException` - if `dst` is `null`
        `java.lang.IllegalArgumentException` - if `nBools-1+srcPos >= 32`
        `java.lang.ArrayIndexOutOfBoundsException` - if `dstPos + nBools > dst.length`

    - #### shortToBinary

          public static boolean[] shortToBinary(short src,
                                int srcPos,
                                boolean[] dst,
                                int dstPos,
                                int nBools)

      Converts a short into an array of boolean using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the short to convert
        `srcPos` - the position in `src`, in bits, from where to start the conversion
        `dst` - the destination array
        `dstPos` - the position in `dst` where to copy the result
        `nBools` - the number of booleans to copy to `dst`, must be smaller or equal to the width of the input (from srcPos to msb)
      Returns:
        `dst`
      Throws:
        `java.lang.NullPointerException` - if `dst` is `null`
        `java.lang.IllegalArgumentException` - if `nBools-1+srcPos >= 16`
        `java.lang.ArrayIndexOutOfBoundsException` - if `dstPos + nBools > dst.length`

    - #### byteToBinary

          public static boolean[] byteToBinary(byte src,
                               int srcPos,
                               boolean[] dst,
                               int dstPos,
                               int nBools)

      Converts a byte into an array of boolean using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the byte to convert
        `srcPos` - the position in `src`, in bits, from where to start the conversion
        `dst` - the destination array
        `dstPos` - the position in `dst` where to copy the result
        `nBools` - the number of booleans to copy to `dst`, must be smaller or equal to the width of the input (from srcPos to msb)
      Returns:
        `dst`
      Throws:
        `java.lang.NullPointerException` - if `dst` is `null`
        `java.lang.IllegalArgumentException` - if `nBools-1+srcPos >= 8`
        `java.lang.ArrayIndexOutOfBoundsException` - if `dstPos + nBools > dst.length`

    - #### uuidToByteArray

          public static byte[] uuidToByteArray(java.util.UUID src,
                               byte[] dst,
                               int dstPos,
                               int nBytes)

      Converts UUID into an array of byte using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the UUID to convert
        `dst` - the destination array
        `dstPos` - the position in `dst` where to copy the result
        `nBytes` - the number of bytes to copy to `dst`, must be smaller or equal to the width of the input (from srcPos to msb)
      Returns:
        `dst`
      Throws:
        `java.lang.NullPointerException` - if `dst` is `null`
        `java.lang.IllegalArgumentException` - if `nBytes > 16`
        `java.lang.ArrayIndexOutOfBoundsException` - if `dstPos + nBytes > dst.length`

    - #### byteArrayToUuid

          public static java.util.UUID byteArrayToUuid(byte[] src,
                                       int srcPos)

      Converts bytes from an array into a UUID using the default (little endian, Lsb0) byte and bit ordering.

      Parameters:
        `src` - the byte array to convert
        `srcPos` - the position in `src` where to copy the result from
      Returns:
        a UUID
      Throws:
        `java.lang.NullPointerException` - if `src` is `null`
        `java.lang.IllegalArgumentException` - if array does not contain at least 16 bytes beginning with `srcPos`