Possible Duplicate:
Create file with given size in Java
Say, I want to create a file of size 1KB, will this approach work? I create a java array like
char[] s = new char[1024]; //1KByte
and write it to a newly created *.txt file using a writer, will the size of the file be 1Kb precisely? If not, how should i create a file of the desired size?