@InterfaceAudience.Private public class ThrottledInputStream extends InputStream
| 构造器和说明 |
|---|
ThrottledInputStream(InputStream rawStream) |
ThrottledInputStream(InputStream rawStream,
long maxBytesPerSec) |
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
String |
toString() |
available, mark, markSupported, reset, skippublic ThrottledInputStream(InputStream rawStream)
public ThrottledInputStream(InputStream rawStream, long maxBytesPerSec)
public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 InputStreamIOExceptionpublic int read()
throws IOException
read 在类中 InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read 在类中 InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read 在类中 InputStreamIOExceptionpublic int read(long position,
byte[] buffer,
int offset,
int length)
throws IOException
PositionedReadable.position - buffer - offset - length - IOExceptionpublic long getTotalBytesRead()
public long getBytesPerSec()
public long getTotalSleepTime()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.