Skip to content

Instantly share code, notes, and snippets.

@y3rsh
Created July 18, 2011 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save y3rsh/1090079 to your computer and use it in GitHub Desktop.
Save y3rsh/1090079 to your computer and use it in GitHub Desktop.
Java to build a file of a specific size
import java.io.*;
public class FileBuilder {
/**
* @param args
*/
public static void main(String[] args) {
try {
RandomAccessFile f = new RandomAccessFile("25.txt", "rw");
f.setLength(26214400); //bytes
} catch (Exception e) {
System.err.println(e);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment