code: public static FileDisk create(File file, long size)
              throws IOException, IllegalArgumentException {
          
          if (size < 0) {
              throw new IllegalArgumentException("size must be >= 0");
          }
          
          try {
              final RandomAccessFile raf =
                      new RandomAccessFile(file, "rw"); //NOI18N
              raf.setLength(size);
              
              return new FileDisk(raf, false);
          } catch (FileNotFoundException ex) {
              throw new IOException(ex);
          }
      }
docs: Creates a new {@code FileDisk} of the specified size. The
  {@code FileDisk} returned by this method will be writable.
  
  @param file the file to hold the {@code FileDisk} contents
  @param size the size of the new {@code FileDisk}
  @return the created {@code FileDisk} instance
  @throws IOException on error creating the {@code FileDisk}
  @throws IllegalArgumentException if size is &lt; 0