@InterfaceAudience.Private public class ThrottledInputStream extends java.io.InputStream
| Constructor and Description |
|---|
ThrottledInputStream(java.io.InputStream rawStream) |
ThrottledInputStream(java.io.InputStream rawStream,
long maxBytesPerSec) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
long |
getBytesPerSec()
Getter for the read-rate from this stream, since creation.
|
long |
getTotalBytesRead()
Getter for the number of bytes read from this stream, since creation.
|
long |
getTotalSleepTime()
Getter the total time spent in sleep.
|
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
int |
read(long position,
byte[] buffer,
int offset,
int length)
Read bytes starting from the specified position.
|
java.lang.String |
toString() |
public ThrottledInputStream(java.io.InputStream rawStream)
public ThrottledInputStream(java.io.InputStream rawStream,
long maxBytesPerSec)
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(long position,
byte[] buffer,
int offset,
int length)
throws java.io.IOException
PositionedReadable.position - buffer - offset - length - java.io.IOExceptionpublic long getTotalBytesRead()
public long getBytesPerSec()
public long getTotalSleepTime()
public java.lang.String toString()
toString in class java.lang.Object