public final class RandomReader extends Reader
Reader that (pseudo) randomly returns characters from a specified
alphabet. This stream has no end of file. Closing a RandomReader has
no effect. Never throws IOExceptions. Thread safe.| Constructor and Description |
|---|
RandomReader(char... alphabet)
Creates a new
RandomReader. |
RandomReader(Random prng,
char... alphabet)
Creates a new
RandomReader. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
read() |
int |
read(char[] cbuf) |
int |
read(char[] cbuf,
int off,
int len) |
public RandomReader(char... alphabet)
RandomReader.alphabet - the source alphabet to use.NullPointerException - if alphabet is null.IllegalArgumentException - if alphabet is empty.public RandomReader(Random prng, char... alphabet)
RandomReader.prng - the source of randomness to use.alphabet - the source alphabet to use.NullPointerException - if one of the arguments is null.IllegalArgumentException - if alphabet is empty.Copyright © 2012–2015. All rights reserved.