Class ByteUtils

java.lang.Object
com.kryptokrauts.aeternity.sdk.util.ByteUtils

public class ByteUtils
extends java.lang.Object
This util class provides all byte related methods
  • Constructor Summary

    Constructors
    Constructor Description
    ByteUtils()  
  • Method Summary

    Modifier and Type Method Description
    static byte[] concatenate​(byte[]... bytes)
    concatenate multiple bytearrays
    static byte[] leftPad​(int length, byte[] data)
    add leading zeros to given byte array
    static byte[] rightPad​(int length, byte[] data)
    add trailing zeros to given byte array

    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

    • concatenate

      public static final byte[] concatenate​(byte[]... bytes)
      concatenate multiple bytearrays
      Parameters:
      bytes - multiple bytearrays to concatenate
      Returns:
      a single, concatenated bytearray
    • leftPad

      public static final byte[] leftPad​(int length, byte[] data)
      add leading zeros to given byte array
      Parameters:
      length - the length the bytearray should have
      data - bytearray to add leading zeros to
      Returns:
      left-padded bytearray
    • rightPad

      public static final byte[] rightPad​(int length, byte[] data)
      add trailing zeros to given byte array
      Parameters:
      length - the length the bytearray should have
      data - bytearray to add trailing zeros to
      Returns:
      right-padded bytearray