A wrapper for
Array[Byte] that provides sane implementations of
toString. The wrapped array of bytes is assumed to be never modified.
Note: Unfortunately we cannot make
Bytes a value class because a value class may not override the
equals methods (cf. SIP-15, criterion 4).
Instead of wrapping an
Array[Byte] with this class you can also convert an
Array[Byte] to a
Seq[Byte] via Scala’s
val arrayByte: Array[Byte] = Array(1.toByte) val seqByte: Seq[Byte] = arrayByte.toSeq
Seq[Byte] has sane
Performance-wise we found that a
Seq[Byte] is comparable to [[Bytes]]. For example, a
CMS[Seq[Byte]] was measured to be only slightly slower than
CMS[Bytes] (think: single-digit percentages).
We’d love your help fleshing out this documentation! You can edit this page in your browser by clicking this link. These links might be helpful: