Package com.ftdi.utils
Class ByteUtils
java.lang.Object
com.ftdi.utils.ByteUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbytesToHex(byte[] bytes) Convert a byte array to a hex string with spaces delimited.static byte[]concat(byte[] array1, byte[] array2) Concat a byte array.static bytegetLowByte(int value) Returns the low byte of an int value.static bytegetLowByte(int value, int mask) Returns the low byte of an int value.
-
Constructor Details
-
ByteUtils
public ByteUtils()
-
-
Method Details
-
bytesToHex
Convert a byte array to a hex string with spaces delimited. Original source: DatatypeConverterImpl.printHexBinary- Parameters:
bytes- the byte array- Returns:
- the formatted hex string
-
getLowByte
public static byte getLowByte(int value) Returns the low byte of an int value.- Parameters:
value- the value- Returns:
- the low byte
-
getLowByte
public static byte getLowByte(int value, int mask) Returns the low byte of an int value.- Parameters:
value- the valuemask- the mask- Returns:
- the low byte
-
concat
public static byte[] concat(byte[] array1, byte[] array2) Concat a byte array.- Parameters:
array1- the first arrayarray2- the second array- Returns:
- the concatenated array
-