private static int storageIdToContentId(long storageId) throws IOException {
    //Math.toIntExact(id) doesn't include id value in the exception message:
    int intStorageId = (int)storageId;
    if (intStorageId != storageId) {
      throw new IOException("Overflow: storageId(=" + storageId + ") > MAX_INT(" + Integer.MAX_VALUE + ")");
    }
    return intStorageId;
  }
private static int storageIdToContentId(long storageId)