assert destPos < getPosition();
// System.out.println("reverse src=" + srcPos + " dest=" + destPos);
int srcBlockIndex = (int) (srcPos >> blockBits);
int src = (int) (srcPos & blockMask);
ByteArray srcBlock = blocks.get(srcBlockIndex);
int destBlockIndex = (int) (destPos >> blockBits);
int dest = (int) (destPos & blockMask);
ByteArray destBlock = blocks.get(destBlockIndex);
// System.out.println(" srcBlock=" + srcBlockIndex + " destBlock=" +
// destBlockIndex);
int limit = (int) (destPos - srcPos + 1) / 2;
for (int i = 0; i < limit; i++) {
// System.out.println(" cycle src=" + src + " dest=" + dest);
byte b = srcBlock.get(src);
srcBlock.put(src, destBlock.get(dest));
destBlock.put(dest, b);
src++;
if (src == blockSize) {
srcBlockIndex++;
srcBlock = blocks.get(srcBlockIndex);
// System.out.println(" set destBlock=" + destBlock + " srcBlock=" +