code: public void truncateFileCount(long count) throws IOException {
          if (count < 0) {
              throw new IllegalArgumentException("count < 0: " + count);
          }
          try {
              mFileTableLock.acquireUpgradableLock();
              long oldCount = getFileCount();
              if (count >= oldCount) {
                  return;
              }
              
              mFileTableLock.acquireWriteLock();
              try {
                  for (long id = oldCount; --id >= count; ) {
                      deleteFile(id);
                  }
                  mFileTable.truncate(count * mFileTableEntrySize);
              }
              finally {
                  mFileTableLock.releaseLock();
              }
          }
          catch (InterruptedException e) {
              throw new InterruptedIOException();
          }
          finally {
              mFileTableLock.releaseLock();
          }
      }
docs: Truncating the file count deletes any files with ids at or above the
  new count.