Created
July 18, 2011 17:14
-
-
Save y3rsh/1090079 to your computer and use it in GitHub Desktop.
Java to build a file of a specific size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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