public class OpaqueBytes extends ByteSequence
A simple class that wraps a byte array and makes the equals/hashCode/toString methods work as you actually expect. In an ideal JVM this would be a value type and be completely overhead free. Project Valhalla is adding such functionality to Java, but it won't arrive for a few years yet!
public OpaqueBytes(@NotNull kotlin.Array[] bytes)
A simple class that wraps a byte array and makes the equals/hashCode/toString methods work as you actually expect. In an ideal JVM this would be a value type and be completely overhead free. Project Valhalla is adding such functionality to Java, but it won't arrive for a few years yet!
@NotNull public kotlin.Array[] getBytes()
The bytes are always cloned so that this object becomes immutable. This has been done
to prevent tampering with entities such as class SecureHash
and class PrivacySalt
, as well as
preserve the integrity of our hash constants net.corda.core.crypto.SecureHash.zeroHash and net.corda.core.crypto.SecureHash.allOnesHash.
Cloning like this may become a performance issue, depending on whether or not the JIT compiler is ever able to optimise away the clone. In which case we may need to revisit this later.
class SecureHash
,
class PrivacySalt
@JvmStatic @NotNull public static OpaqueBytes of(@NotNull byte... b)
Create class OpaqueBytes
from a sequence of Byte values.
class OpaqueBytes
,
Byte