Class AssetUtil

java.lang.Object
at.qubic.api.util.AssetUtil

public class AssetUtil extends Object
  • Constructor Details

    • AssetUtil

      public AssetUtil()
  • Method Details

    • nameToString

      public static String nameToString(byte[] name)
      Creates an ascii string out of the specified input byte array. Null characters are trimmed.
      Parameters:
      name - The byte array containing the name.
      Returns:
      The byte array converted to a string.
    • nameTo8Bytes

      public static byte[] nameTo8Bytes(String name)
      Return input string as byte[8]. The last byte is zero (null terminated string).
      Parameters:
      name - The input string. Shouldn't be more than 7 bytes. Other bytes are ignored.
      Returns:
      The name as null terminated byte array of length 8.
    • unitOfMeasurementTo8Bytes

      public static byte[] unitOfMeasurementTo8Bytes(String unitOfMeasurement)
      Converts a unit of measurement string to bytes. Letters are mapped to their corresponding byte value. "00000020" is converted to byte {0,0,0,0,0,0,2,0} for example.
      Parameters:
      unitOfMeasurement - String describing the units of measurement for an asset.
      Returns:
      The units of measurement in byte array format.
    • unitOfMeasurementToString

      public static String unitOfMeasurementToString(byte[] input)
      Converts a units of measurement array to a readable string. byte values are mapped to their corresponding ascii letters, for example 0 is mapped to the '0' characters.
      Parameters:
      input - The units of measurement bytes. Only the first 7 bytes are converted.
      Returns:
      An ascii string representing the units of measurement.