@Override
  public long allocateSpace(int len) throws IOException {
    final long result = Math.max(myFile.length(), HEADER_SIZE);

    // Fill them in so we won't give out wrong address from allocateSpace() next time if they still not finished writing to allocated page
    long newLength = result + len;
    writeBytes(newLength - 1, new byte[]{0});
    long actualLength = myFile.length();
    if (actualLength != newLength) {
      LOG.error("Failed to resize the storage at: " + myFile + ". Required: " + newLength + ", actual: " + actualLength);
    }
    return result;
  }
@Override
  public long allocateSpace(int len)