class SerializedBytes<T : Any> : OpaqueBytes
A type safe wrapper around a byte array that contains a serialised object. You can call SerializedBytes.deserialize to get the original object back.
SerializedBytes(bytes: ByteArray)
A type safe wrapper around a byte array that contains a serialised object. You can call SerializedBytes.deserialize to get the original object back. |
val hash: SecureHash |
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. |
fun <T : Any> from(obj: T, serializationFactory: SerializationFactory = SerializationFactory.defaultFactory, context: SerializationContext = serializationFactory.defaultContext): SerializedBytes<T>
Serializes the given object and returns a SerializedBytes wrapper for it. An alias for Any.serialize intended to make the calling smoother for Java users. |
val OpaqueBytes.isZero: Boolean |
fun Any.contextLogger(): <ERROR CLASS>
When called from a companion object, returns the logger for the enclosing class. |
|
fun <T : Any> SerializedBytes<T>.deserialize(serializationFactory: SerializationFactory = SerializationFactory.defaultFactory, context: SerializationContext = serializationFactory.defaultContext): T
Convenience extension method for deserializing SerializedBytes with type matching, utilising the defaults. |
|
fun <T : Any> ByteSequence.deserializeWithCompatibleContext(serializationFactory: SerializationFactory = SerializationFactory.defaultFactory, context: SerializationContext = serializationFactory.defaultContext): ObjectWithCompatibleContext<T>
Additionally returns SerializationContext which was used for encoding. It might be helpful to know SerializationContext to use the same encoding in the reply. |
|
fun OpaqueBytes.hashAs(algorithm: String): SecureHash
Compute the algorithm hash for the contents of the OpaqueBytes. |
|
fun OpaqueBytes.sha256(): SHA256
Compute the SHA-256 hash for the contents of the OpaqueBytes. |