Class ByteHelpers

java.lang.Object
com.pi4j.crowpi.components.helpers.ByteHelpers

public class ByteHelpers extends Object
This class provides various helper methods for dealing with byte arrays.
  • Constructor Details

    • ByteHelpers

      public ByteHelpers()
  • Method Details

    • toArray

      public static byte[] toArray(List<Byte> values)
      Converts a Byte-List into an array of bytes
      Parameters:
      values - List of bytes
      Returns:
      Array of bytes
    • toString

      public static String toString(byte value)
      Converts a single byte into a 0x prefixed hexadecimal string
      Parameters:
      value - Byte to convert
      Returns:
      Human-readable hexadecimal string
    • toString

      public static String toString(byte[] bytes)
      Converts an array of bytes into a 0x prefixed hexadecimal string
      Parameters:
      bytes - Bytes to convert
      Returns:
      Human-readable hexadecimal string