@Override
        public void write(int b) throws IOException {
          if (same) {
            if (offsetInPage == pageSize) {    // reached end of current page
              offsetInFile = ((offsetInFile / pageSize) + 1) * pageSize;
              if (offsetInFile >= fileLength) {
                same = false;
                return;
              }

              buffer.unlock();
              buffer = storage.getByteBuffer(offsetInFile, false);
              offsetInPage = 0;
            }

            same = buffer.get(offsetInPage, true) == (byte)b;
            offsetInPage++;
          }
        }
@Override
        public void write(int b)