protected static class ThrottledFetcher.ThrottledInputstream extends InputStream
Modifier and Type | Field and Description |
---|---|
protected InputStream |
inputStream
The stream we are wrapping.
|
protected IStreamThrottler |
streamThrottler
Stream throttler
|
protected ThrottledFetcher.ThrottledConnection |
throttledConnection
The throttled connection we belong to
|
Constructor and Description |
---|
ThrottledFetcher.ThrottledInputstream(IStreamThrottler streamThrottler,
ThrottledFetcher.ThrottledConnection connection,
InputStream is)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
available()
Get available.
|
protected int |
basicRead(byte[] b,
int off,
int len,
int totalSoFar)
Basic read, which uses the server object to throttle activity.
|
void |
close()
Close.
|
void |
mark(int readLimit)
Mark.
|
boolean |
markSupported()
Check if mark is supported.
|
int |
read()
Read a byte.
|
int |
read(byte[] b)
Read lots of bytes.
|
int |
read(byte[] b,
int off,
int len)
Read lots of specific bytes.
|
void |
reset()
Reset.
|
long |
skip(long n)
Skip
|
protected final IStreamThrottler streamThrottler
protected final ThrottledFetcher.ThrottledConnection throttledConnection
protected final InputStream inputStream
public ThrottledFetcher.ThrottledInputstream(IStreamThrottler streamThrottler, ThrottledFetcher.ThrottledConnection connection, InputStream is)
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] b) throws IOException
read
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
protected int basicRead(byte[] b, int off, int len, int totalSoFar) throws IOException
IOException
public long skip(long n) throws IOException
skip
in class InputStream
IOException
public int available() throws IOException
available
in class InputStream
IOException
public void mark(int readLimit)
mark
in class InputStream
public void reset() throws IOException
reset
in class InputStream
IOException
public boolean markSupported()
markSupported
in class InputStream
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException