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:
char containing a hexadecimal digit (lowercase in destination)
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" (Camel-case).
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.
| Modifier and Type | Field and Description |
|---|---|
| private static final boolean[] | |
| private static final boolean[] | |
| private static final boolean[] | |
| private static final boolean[] | |
| private static final boolean[] | |
| private static final boolean[] | |
| private static final boolean[] | |
| private static final boolean[] | |
| private static final boolean[] | |
| private static final boolean[] | |
| private static final boolean[] | |
| private static final boolean[] | |
| private static final boolean[] | |
| private static final boolean[] | |
| private static final boolean[] | |
| private static final boolean[] |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static char | Returns: a hexadecimal digit representing the selected bits.the binary to convert. src)Converts the first 4 bits of a binary (represented as boolean array) in big-endian MSB0 bit ordering to a hexadecimal digit. |
| public static char | Returns: a hexadecimal digit representing the selected bits.the binary to convert. src, final int the position of the LSB to start the conversion. srcPos)Converts a binary (represented as boolean array) in big-endian MSB0 bit ordering to a hexadecimal digit. |
| public static byte | Returns: a byte containing the selected bits.the binary to convert. src, final int the position in srcPos, final byte src, in boolean unit, from where to start the conversion.initial value of the destination byte. dstInit, final int the position of the LSB, in bits, in the result byte. dstPos, final int the number of booleans to convert. nBools)Converts binary (represented as boolean array) into a byte using the default (little-endian, LSB0) byte and bit ordering. |
| public static char | Returns: a hexadecimal digit representing the selected bits.the binary to convert. src)Converts binary (represented as boolean array) to a hexadecimal digit using the default (LSB0) bit ordering. |
| public static char | Returns: a hexadecimal digit representing the selected bits.the binary to convert. src, final int the position of the LSB to start the conversion. srcPos)Converts binary (represented as boolean array) to a hexadecimal digit using the default (LSB0) bit ordering. |
| public static char | Returns: a hexadecimal digit representing the selected bits.the binary to convert. src)Converts binary (represented as boolean array) to a hexadecimal digit using the MSB0 bit ordering. |
| public static char | Returns: a hexadecimal digit representing the selected bits.the binary to convert. src, final int the position of the LSB to start the conversion. srcPos)Converts binary (represented as boolean array) to a hexadecimal digit using the MSB0 bit ordering. |
| public static int | Returns: an int containing the selected bits.the binary to convert. src, final int the position in srcPos, final int src, in boolean unit, from where to start the conversion.initial value of the destination int. dstInit, final int the position of the LSB, in bits, in the result int. dstPos, final int the number of booleans to convert. nBools)Converts binary (represented as boolean array) into an int using the default (little endian, LSB0) byte and bit ordering. |
| public static long | Returns: a long containing the selected bits.the binary to convert. src, final int the position in srcPos, final long src, in boolean unit, from where to start the conversion.initial value of the destination long. dstInit, final int the position of the LSB, in bits, in the result long. dstPos, final int the number of booleans to convert. nBools)Converts binary (represented as boolean array) into a long using the default (little endian, LSB0) byte and bit ordering. |
| public static short | Returns: a short containing the selected bits.the binary to convert. src, final int the position in srcPos, final short src, in boolean unit, from where to start the conversion.initial value of the destination short. dstInit, final int the position of the LSB, in bits, in the result short. dstPos, final int the number of booleans to convert. nBools)Converts binary (represented as boolean array) into a short using the default (little endian, LSB0) byte and bit ordering. |
| public static int | Returns: an int containing the selected bits.the byte array to convert. src, final int the position in srcPos, final int src, in byte unit, from where to start the conversion.initial value of the destination int. dstInit, final int the position of the LSB, in bits, in the result int. dstPos, final int the number of bytes to convert. nBytes)Converts an array of byte into an int using the default (little-endian, LSB0) byte and bit ordering. |
| public static long | Returns: a long containing the selected bits.the byte array to convert. src, final int the position in srcPos, final long src, in byte unit, from where to start the conversion.initial value of the destination long. dstInit, final int the position of the LSB, in bits, in the result long. dstPos, final int the number of bytes to convert. nBytes)Converts an array of byte into a long using the default (little-endian, LSB0) byte and bit ordering. |
| public static short | Returns: a short containing the selected bits.the byte array to convert. src, final int the position in srcPos, final short src, in byte unit, from where to start the conversion.initial value of the destination short. dstInit, final int the position of the LSB, in bits, in the result short. dstPos, final int the number of bytes to convert. nBytes)Converts an array of byte into a short using the default (little-endian, LSB0) byte and bit ordering. |
| public static UUID | Returns: a UUID.the byte array to convert. src, final int the position in srcPos)src where to copy the result from.Converts bytes from an array into a UUID using the default (little-endian, LSB0) byte and bit ordering. |
| public static boolean[] | Returns: dst.the byte to convert. src, final int the position in srcPos, final boolean[] src, in bits, from where to start the conversion.the destination array. dst, final int the position in dstPos, final int dst where to copy the result.the number of booleans to copy to nBools)dst, must be smaller or equal to the width of the input (from srcPos to MSB).Converts a byte into an array of boolean using the default (little-endian, LSB0) byte and bit ordering. |
| public static String | Returns: dst.the byte to convert. src, final int the position in srcPos, final String src, in bits, from where to start the conversion.the initial value for the result String. dstInit, final int the position in dstPos, final int dst where to copy the result.the number of chars to copy to nHexs)dst, must be smaller or equal to the width of the input (from srcPos to MSB).Converts a byte into an array of char using the default (little-endian, LSB0) byte and bit ordering. |
| public static boolean[] | Returns: a boolean array with the binary representation ofhexDigit.the hexadecimal digit to convert. hexChar)Converts a hexadecimal digit into binary (represented as boolean array) using the MSB0 bit ordering. |
| public static int | Returns: an int equals tohexDigit.the hexadecimal digit to convert. hexChar)Converts a hexadecimal digit into an int using the MSB0 bit ordering. |
| public static boolean[] | Returns: a boolean array with the binary representation ofhexDigit.the hexadecimal digit to convert. hexChar)Converts a hexadecimal digit into binary (represented as boolean array) using the default (LSB0) bit ordering. |
| public static int | Returns: an int equals tohexDigit.the hexadecimal digit to convert. hexChar)Converts a hexadecimal digit into an int using the default (LSB0) bit ordering. |
| public static byte | Returns: a byte containing the selected bits.the hexadecimal string to convert. src, final int the position in srcPos, final byte src, in char unit, from where to start the conversion.initial value of the destination byte. dstInit, final int the position of the LSB, in bits, in the result byte. dstPos, final int the number of Chars to convert. nHex)Converts a hexadecimal string into a byte using the default (little-endian, LSB0) byte and bit ordering. |
| public static int | Returns: an int containing the selected bits.the hexadecimal string to convert. src, final int the position in srcPos, final int src, in char unit, from where to start the conversion.initial value of the destination int. dstInit, final int the position of the LSB, in bits, in the result int. dstPos, final int the number of chars to convert. nHex)Converts an array of char into an int using the default (little-endian, LSB0) byte and bit ordering. |
| public static long | Returns: a long containing the selected bits.the hexadecimal string to convert. src, final int the position in srcPos, final long src, in char unit, from where to start the conversion.initial value of the destination long. dstInit, final int the position of the LSB, in bits, in the result long. dstPos, final int the number of chars to convert. nHex)Converts an array of char into a long using the default (little-endian, LSB0) byte and bit ordering. |
| public static short | Returns: a short containing the selected bits.the hexadecimal string to convert. src, final int the position in srcPos, final short src, in char unit, from where to start the conversion.initial value of the destination short. dstInit, final int the position of the LSB, in bits, in the result short. dstPos, final int the number of chars to convert. nHex)Converts an array of char into a short using the default (little-endian, LSB0) byte and bit ordering. |
| public static long | Returns: a long containing the selected bits.the int array to convert. src, final int the position in srcPos, final long src, in int unit, from where to start the conversion.initial value of the destination long. dstInit, final int the position of the LSB, in bits, in the result long. dstPos, final int the number of ints to convert. nInts)Converts an array of int into a long using the default (little-endian, LSB0) byte and bit ordering. |
| public static boolean[] | Returns: dst.the int to convert. src, final int the position in srcPos, final boolean[] src, in bits, from where to start the conversion.the destination array. dst, final int the position in dstPos, final int dst where to copy the result.the number of booleans to copy to nBools)dst, must be smaller or equal to the width of the input (from srcPos to MSB).Converts an int into an array of boolean using the default (little-endian, LSB0) byte and bit ordering. |
| public static byte[] | Returns: dst.the int to convert. src, final int the position in srcPos, final byte[] src, in bits, from where to start the conversion.the destination array. dst, final int the position in dstPos, final int dst where to copy the result.the number of bytes to copy to nBytes)dst, must be smaller or equal to the width of the input (from srcPos to MSB).Converts an int into an array of byte using the default (little-endian, LSB0) byte and bit ordering. |
| public static String | Returns: dst.the int to convert. src, final int the position in srcPos, final String src, in bits, from where to start the conversion.the initial value for the result String. dstInit, final int the position in dstPos, final int dst where to copy the result.the number of chars to copy to nHexs)dst, must be smaller or equal to the width of the input (from srcPos to MSB).Converts an int into an array of char using the default (little-endian, LSB0) byte and bit ordering. |
| public static char | Returns: a hexadecimal digit representing the 4 LSB ofnibble.the 4 bits to convert. nibble)Converts the 4 LSB of an int to a hexadecimal digit. |
| public static char | Returns: a hexadecimal digit representing the 4 LSB ofnibble.the 4 bits to convert. nibble)Converts the 4 LSB of an int to a hexadecimal digit encoded using the MSB0 bit ordering. |
| public static short[] | Returns: dst.the int to convert. src, final int the position in srcPos, final short[] src, in bits, from where to start the conversion.the destination array. dst, final int the position in dstPos, final int dst where to copy the result.the number of shorts to copy to nShorts)dst, must be smaller or equal to the width of the input (from srcPos to MSB).Converts an int into an array of short using the default (little-endian, LSB0) byte and bit ordering. |
| public static boolean[] | Returns: dst.the long to convert. src, final int the position in srcPos, final boolean[] src, in bits, from where to start the conversion.the destination array. dst, final int the position in dstPos, final int dst where to copy the result.the number of booleans to copy to nBools)dst, must be smaller or equal to the width of the input (from srcPos to MSB).Converts a long into an array of boolean using the default (little-endian, LSB0) byte and bit ordering. |
| public static byte[] | Returns: dst.the long to convert. src, final int the position in srcPos, final byte[] src, in bits, from where to start the conversion.the destination array. dst, final int the position in dstPos, final int dst where to copy the result.the number of bytes to copy to nBytes)dst, must be smaller or equal to the width of the input (from srcPos to MSB).Converts a long into an array of byte using the default (little-endian, LSB0) byte and bit ordering. |
| public static String | Returns: dst.the long to convert. src, final int the position in srcPos, final String src, in bits, from where to start the conversion.the initial value for the result String. dstInit, final int the position in dstPos, final int dst where to copy the result.the number of chars to copy to nHexs)dst, must be smaller or equal to the width of the input (from srcPos to MSB).Converts a long into an array of char using the default (little-endian, LSB0) byte and bit ordering. |
| public static int[] | Returns: dst.the long to convert. src, final int the position in srcPos, final int[] src, in bits, from where to start the conversion.the destination array. dst, final int the position in dstPos, final int dst where to copy the result.the number of ints to copy to nInts)dst, must be smaller or equal to the width of the input (from srcPos to MSB).Converts a long into an array of int using the default (little-endian, LSB0) byte and bit ordering. |
| public static short[] | Returns: dst.the long to convert. src, final int the position in srcPos, final short[] src, in bits, from where to start the conversion.the destination array. dst, final int the position in dstPos, final int dst where to copy the result.the number of shorts to copy to nShorts)dst, must be smaller or equal to the width of the input (from srcPos to MSB).Converts a long into an array of short using the default (little-endian, LSB0) byte and bit ordering. |
| public static int | Returns: an int containing the selected bits.the short array to convert. src, final int the position in srcPos, final int src, in short unit, from where to start the conversion.initial value of the destination int. dstInit, final int the position of the LSB, in bits, in the result int. dstPos, final int the number of shorts to convert. nShorts)Converts an array of short into an int using the default (little-endian, LSB0) byte and bit ordering. |
| public static long | Returns: a long containing the selected bits.the short array to convert. src, final int the position in srcPos, final long src, in short unit, from where to start the conversion.initial value of the destination long. dstInit, final int the position of the LSB, in bits, in the result long. dstPos, final int the number of shorts to convert. nShorts)Converts an array of short into a long using the default (little-endian, LSB0) byte and bit ordering. |
| public static boolean[] | Returns: dst.the short to convert. src, final int the position in srcPos, final boolean[] src, in bits, from where to start the conversion.the destination array. dst, final int the position in dstPos, final int dst where to copy the result.the number of booleans to copy to nBools)dst, must be smaller or equal to the width of the input (from srcPos to MSB).Converts a short into an array of boolean using the default (little-endian, LSB0) byte and bit ordering. |
| public static byte[] | Returns: dst.the short to convert. src, final int the position in srcPos, final byte[] src, in bits, from where to start the conversion.the destination array. dst, final int the position in dstPos, final int dst where to copy the result.the number of bytes to copy to nBytes)dst, must be smaller or equal to the width of the input (from srcPos to MSB).Converts a short into an array of byte using the default (little-endian, LSB0) byte and bit ordering. |
| public static String | Returns: dst.the short to convert. src, final int the position in srcPos, final String src, in bits, from where to start the conversion.the initial value for the result String. dstInit, final int the position in dstPos, final int dst where to copy the result.the number of chars to copy to nHexs)dst, must be smaller or equal to the width of the input (from srcPos to MSB).Converts a short into an array of char using the default (little-endian, LSB0) byte and bit ordering. |
| public static byte[] | Returns: dst.the UUID to convert. src, final byte[] the destination array. dst, final int the position in dstPos, final int dst where to copy the result.the number of bytes to copy to nBytes)dst, must be smaller or equal to the width of the input (from srcPos to MSB).Converts UUID into an array of byte using the default (little-endian, LSB0) byte and bit ordering. |