Class ByteSeq

java.lang.Object
dev.enola.common.ByteSeq
All Implemented Interfaces:
Comparable<ByteSeq>

@Immutable public final class ByteSeq extends Object implements Comparable<ByteSeq>
Immutable Sequence of Bytes, of variable (but obviously fixed) length.

Typically intended to be used for "small"(-ish) size, like binary IDs, hashes, cryptographic keys, and such things; do not use this for "very large BLOBs". The hashCode is cached.

The com.google.protobuf.ByteString is very similar - but we don't want to depend on the ProtoBuf library JUST for having a type like this. Likewise, com.google.crypto.tink.util.Bytes is similar.

This intentionally does not implement Iterable<Byte> to avoid boxing overhead.