public class SlipOutputStream extends Object
| Constructor and Description |
|---|
SlipOutputStream(OutputStream outputStream)
Constructs a new non-threaded SlipOutputStream
|
SlipOutputStream(OutputStream outputStream,
boolean threaded)
Constructs a new SlipOutputStream, optionally with an internal thread
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
send(byte[] packet) |
void |
setThrottlingPeriod(long throttlingPeriod)
Enforces a delay between the sending of consecutive packets, necessary for downstream applications which
are sensitive to data rate
|
public SlipOutputStream(OutputStream outputStream, boolean threaded)
outputStream - the lower-level stream to which to write packet datathreaded - if true, this stream will synchronize outbound serial communications
using an internal threadpublic SlipOutputStream(OutputStream outputStream)
outputStream - the wrapped, transport-level streampublic void setThrottlingPeriod(long throttlingPeriod)
throttlingPeriod - the minimum time in milliseconds between the moment at which we begin to send one
packet and the moment at which we begin to send the next
Note: a throttling period is not necessary to ensure synchronous and sequential writing
of packets to the output stream (for that, use the threaded option)public void send(byte[] packet)
throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionCopyright © 2017. All Rights Reserved.