equals()/hashCode() & tests for ByteArrays to avoid materializing a
full byte[].

Fixes #5435