|
Java™ by example!
|
|
|
How do I generate a random set of bytes?
Use the class Random. It contains a function nextBytes to which you pass a byte array of a certain length. After the call, each element of this byte array will contain a random byte value. Main.java:
outputs:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|