public class StreamGobbler extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
StreamGobbler.Listener
A listener which listens to a
StreamGobbler InputStream. |
| Constructor and Description |
|---|
StreamGobbler(InputStream in)
Constructor with the default UTF-8 charset.
|
StreamGobbler(InputStream in,
Charset charset)
Constructor.
|
StreamGobbler(InputStream in,
String charset)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the Gobbler.
|
InputStream |
getInputStream()
Return the underlying InputStream.
|
StreamGobbler.Listener |
getListener()
Return the InputStream listener.
|
boolean |
isClosed()
Return true if the globbler is closed.
|
boolean |
isQueued()
Return true if the gobbler is queue.
|
boolean |
isStarted()
Return true if the globbler is started.
|
void |
setListener(StreamGobbler.Listener listener)
Set the InputStream listener.
|
void |
setQueued(boolean isQueued)
Set if the gobbler is queued.
|
void |
setQueued(boolean isQueued,
int delay)
Set if the gobbler is queued.It will not do anything if the gobbler is started.
|
void |
setQueued(boolean isQueued,
int delay,
int pollingRate)
Set if the gobbler is queued.
|
void |
start()
Start the Gobbler.
|
void |
stop()
Stop the Gobbler.
|
public StreamGobbler(InputStream in)
in - the InputStreampublic StreamGobbler(InputStream in, String charset)
in - the InputStreamcharset - the charset namepublic StreamGobbler(InputStream in, Charset charset)
in - the InputStreamcharset - the charsetpublic void setQueued(boolean isQueued)
isQueued - true if the gobbler is queuedpublic void setQueued(boolean isQueued,
int delay)
isQueued - true if the gobbler is queueddelay - the queueing delaypublic void setQueued(boolean isQueued,
int delay,
int pollingRate)
isQueued - true if the gobbler is queueddelay - the queueing delaypollingRate - the polling rate of the queuepublic boolean isQueued()
public void setListener(StreamGobbler.Listener listener)
listener - the listenerpublic StreamGobbler.Listener getListener()
public InputStream getInputStream()
public boolean isStarted()
public boolean isClosed()
public void start()
public void close()
public void stop()