org.opengroup.arm40.transaction

Interface ArmToken

    • Method Summary

      Methods 
      Modifier and Type Method and Description
      boolean copyBytes(byte[] dest)
      Copies the token to a byte array that is already allocated.
      boolean copyBytes(byte[] dest, int offset)
      Copies the token to a byte array that is already allocated.
      byte[] getBytes()
      Returns a newly allocated byte array into which the token is copied.
      int getLength()
      Gets the length of the byte array part.
    • Method Detail

      • copyBytes

        boolean copyBytes(byte[] dest)
        Copies the token to a byte array that is already allocated.
        Parameters:
        dest - destination byte array. Its length must be greater than or equal to the length of the token's byte array.
        Returns:
        true if the operation was successful, false otherwise. If false, the contents of the target array are undetermined. The most likely errors are an attempt to copy into a null pointer or into an array that is not long enough to hold the entire token.
      • copyBytes

        boolean copyBytes(byte[] dest,
                        int offset)
        Copies the token to a byte array that is already allocated.
        Parameters:
        dest - destination byte array. (dest.length-offset) must be greater than or equal to the length of the token's byte array.
        offset - offset in dest to copying at.
        Returns:
        true if the operation was successful, false otherwise. If false, the contents of the target array are undetermined. The most likely errors are an attempt to copy into a null pointer or into an array that is not long enough to hold the entire token.
      • getBytes

        byte[] getBytes()
        Returns a newly allocated byte array into which the token is copied.

        This is equivalent to creating a byte array of length getLength() and then executing copyBytes() into the new array. The ARM implementation would typically not keep a reference to the array, because that would interfere with garbage collection.

        Returns:
        a byte array containing a copy of the token's byte array part.
      • getLength

        int getLength()
        Gets the length of the byte array part.
        Returns:
        the size of the byte array part of the token.