Class ByteUtils

java.lang.Object
com.ftdi.utils.ByteUtils

public class ByteUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    bytesToHex(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 byte
    getLowByte(int value)
    Returns the low byte of an int value.
    static byte
    getLowByte(int value, int mask)
    Returns the low byte of an int value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ByteUtils

      public ByteUtils()
  • Method Details

    • bytesToHex

      public static String bytesToHex(byte[] bytes)
      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 value
      mask - the mask
      Returns:
      the low byte
    • concat

      public static byte[] concat(byte[] array1, byte[] array2)
      Concat a byte array.
      Parameters:
      array1 - the first array
      array2 - the second array
      Returns:
      the concatenated array