Methods Summary |
---|
public int | available()
// Limited only by available memory and the size of an array.
return Integer.MAX_VALUE;
|
private void | checkOpen()
if (closed) throw new IOException("Input stream closed");
|
public void | close()
this.closed = true;
|
public int | read()
checkOpen();
int result = generator.nextInt() % 256;
if (result < 0) result = -result;
return result;
|
public int | read(byte[] data, int offset, int length)
checkOpen();
byte[] temp = new byte[length];
generator.nextBytes(temp);
System.arraycopy(temp, 0, data, offset, length);
return length;
|
public int | read(byte[] data)
checkOpen();
generator.nextBytes(data);
return data.length;
|
public long | skip(long bytesToSkip)
checkOpen();
// It's all random so skipping has no effect.
return bytesToSkip;
|