code: long getPreferredBlockSize(String filename) throws IOException {
      byte[][] components = INodeDirectory.getPathComponents(filename);
      readLock();
      try {
        INode fileNode = rootDir.getNode(components);
        if (fileNode == null) {
          throw new IOException("Unknown file: " + filename);
        }
        if (fileNode.isDirectory()) {
          throw new IOException("Getting block size of a directory: " +
                                filename);
        }
        return ((INodeFile)fileNode).getPreferredBlockSize();
      } finally {
        readUnlock();
      }
    }
docs: Get the blocksize of a file
  @param filename the filename
  @return the number of bytes
  @throws IOException if it is a directory or does not exist.