if (newSize > capacity) {
if (oldSize > 0) {
final byte[] newbytes = new byte[newSize];
System.arraycopy(readBytes(record), 0, newbytes, 0, oldSize);
System.arraycopy(bytes.getBytes(), bytes.getOffset(), newbytes, oldSize, delta);
writeBytes(record, new ByteSequence(newbytes), false);
}
else {
writeBytes(record, bytes, false);
}
}