mirror of
https://github.com/corda/corda.git
synced 2025-01-18 02:39:51 +00:00
Minor: OpaqueBytes should never be empty. May catch certain types of simple mistake.
This commit is contained in:
parent
6c66eee712
commit
2c27a07c8b
@ -7,6 +7,8 @@ import java.util.*
|
||||
|
||||
/** A simple class that wraps a byte array and makes the equals/hashCode/toString methods work as you actually expect */
|
||||
open class OpaqueBytes(val bits: ByteArray) : SerializeableWithKryo {
|
||||
init { check(bits.isNotEmpty()) }
|
||||
|
||||
companion object {
|
||||
fun of(vararg b: Byte) = OpaqueBytes(byteArrayOf(*b))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user