Pure Programmer
Blue Matrix


Cluster Map

Project: Random Bytes

Write a program to generate a random stream of bytes. The program should accept three values on the command line: minimum byte value, maximum byte value and the number of bytes to generate. Include assertions to check that the command line min and max are in the range 0-255.

Output
$ javac -Xlint RandomBytes.java $ java -ea RandomBytes 32 126 100 k6{?g;i~,{;,yr7IdujQC%n"W_Tf(>e"sde>djO[Nq1GCseiB ECOMK$q>{0ZR&|U}YDn#8g*MDfElFTv8WD QNW$qMS=t8hX%z$$ javac -Xlint RandomBytes.java $ java -ea RandomBytes 48 57 100 7081735095975890260718849628686166498962952559974054295288126456588967500231954327224923060679272045

Solution