|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.io.InputStream
org.apache.manifoldcf.crawler.connectors.webcrawler.ThrottledFetcher.ThrottledInputstream
protected static class ThrottledFetcher.ThrottledInputstream
This class throttles an input stream based on the specified byte rate parameters. The throttling takes place across all streams that are open to the server in question.
| Field Summary | |
|---|---|
protected ThrottledFetcher.DataSession |
dataSession
|
protected java.io.InputStream |
inputStream
The stream we are wrapping. |
protected double |
minimumMillisecondsPerBytePerServer
Stream throttling parameters |
protected ThrottledFetcher.ThrottledConnection |
throttledConnection
The throttled connection we belong to |
| Constructor Summary | |
|---|---|
ThrottledFetcher.ThrottledInputstream(ThrottledFetcher.ThrottledConnection connection,
java.io.InputStream is,
ThrottledFetcher.DataSession dataSession)
Constructor. |
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected double minimumMillisecondsPerBytePerServer
protected ThrottledFetcher.ThrottledConnection throttledConnection
protected java.io.InputStream inputStream
protected ThrottledFetcher.DataSession dataSession
| Constructor Detail |
|---|
public ThrottledFetcher.ThrottledInputstream(ThrottledFetcher.ThrottledConnection connection,
java.io.InputStream is,
ThrottledFetcher.DataSession dataSession)
| Method Detail |
|---|
public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public int read(byte[] b)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
public int read(byte[] b,
int off,
int len)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOException
protected int basicRead(byte[] b,
int off,
int len,
int totalSoFar)
throws java.io.IOException
java.io.IOException
public long skip(long n)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOException
public int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionpublic void mark(int readLimit)
mark in class java.io.InputStream
public void reset()
throws java.io.IOException
reset in class java.io.InputStreamjava.io.IOExceptionpublic boolean markSupported()
markSupported in class java.io.InputStream
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in class java.io.InputStreamjava.io.IOException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||