@Override
public Binary readBytes() {
int prefixLength = prefixLengthReader.readInteger();
// This does not copy bytes
Binary suffix = suffixReader.readBytes();
int length = prefixLength + suffix.length();
// We have to do this to materialize the output
if(prefixLength != 0) {
byte[] out = new byte[length];
System.arraycopy(previous.getBytes(), 0, out, 0, prefixLength);
System.arraycopy(suffix.getBytes(), 0, out, prefixLength, suffix.length());
previous = Binary.fromByteArray(out);
} else {
previous = suffix;
}
return previous;