public class RandomInputStream extends InputStream
| Modifier and Type | Field and Description |
|---|---|
protected long |
lengthInBytes
The requested amount of data contained in this random stream
|
protected long |
remainingBytes
The number of bytes of data remaining in this random stream
|
| Constructor and Description |
|---|
RandomInputStream(long lengthInBytes)
Constructs a new InputStream, which will return the specified amount
of bytes of random ASCII characters.
|
RandomInputStream(long lengthInBytes,
boolean binaryData)
Creates a new random input stream of specified length, and specifies
whether the stream should be full on binary or character data.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getBytesRead() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
available, close, mark, markSupported, read, reset, skipprotected final long lengthInBytes
protected long remainingBytes
public RandomInputStream(long lengthInBytes)
lengthInBytes - The size in bytes of the total data returned by this
stream.public RandomInputStream(long lengthInBytes,
boolean binaryData)
lengthInBytes - The number of bytes in the stream.binaryData - Whether binary or character data should be generated.public int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic long getBytesRead()
Copyright © 2025. All rights reserved.