Videos
You can generate these files yourself - a relatively simple algorithm should be sufficient:
- Go through numbers
cfrom 0 to 255 sequentially - For each number
c, generate a random numbernin the range from 1 to 4, inclusive - Add
nvalues ofcto a list - If the number of items in the list is less than 500 (this is very unlikely) you can set
cback to0, and continue with the same algorithm until you cross the 500 count. - Apply the random shuffle algorithm to the list
- Write the results to a file.
I'm not a java programmer ( I don't know a bit of java ), I'm a c programmer. But, what you want to do is pretty simple. I found an example that you should check out.
http://www.java2s.com/Code/Java/File-Input-Output/Writesomedatainbinary.htm
You need to modify the code so that you are writing bytes, instead of integers. And you should do it in a loop. If it needs to be random, do as dasblinkenlight suggested. The following snippet I wrote replaces the one in the link I gave you.
import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class WriteBinary {
public static void main(String[] argv) throws IOException {
String FILENAME = "binary.dat";
DataOutputStream os = new DataOutputStream(new FileOutputStream(
FILENAME));
for( int i = 0; i < 256; i++ ) os.writeByte( (byte) i );
os.close();
}
}
You should also note that not all ascii values are printable characters. So, when you view the files, you wont be able to count 256 characters. But, you should be able to see the whole alphabet and 0 - 9.