corda / net.corda.core.utilities / OpaqueBytes / bytes

bytes

val bytes: ByteArray

The bytes are always cloned so that this object becomes immutable. This has been done to prevent tampering with entities such as net.corda.core.crypto.SecureHash and net.corda.core.contracts.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.