public class JslipcChannelOutputStream extends OutputStream implements TimeoutAware
WritableJslipcByteChannel
in order to provide a blocking OutputStream.Constructor and Description |
---|
JslipcChannelOutputStream(WritableJslipcByteChannel channel)
Creates a JslipcChannelOutputStream based on the underlying channel.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
getTimeout() |
void |
setTimeout(int timeout)
Sets the timeout to wait on blocking operations.
|
protected void |
sleep(long waitingSince)
Sleeps for the default time and watches for timeouts.
|
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
protected void |
writeBlocking(ByteBuffer buffer) |
flush, write
public JslipcChannelOutputStream(WritableJslipcByteChannel channel)
channel
- public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class OutputStream
IOException
public void write(int b) throws IOException
write
in class OutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
IOException
protected void writeBlocking(ByteBuffer buffer) throws IOException, InterruptedIOException, ClosedChannelException
public int getTimeout()
getTimeout
in interface TimeoutAware
public void setTimeout(int timeout)
TimeoutAware
setTimeout
in interface TimeoutAware
protected void sleep(long waitingSince) throws InterruptedIOException
waitingSince
- the timestamp when the operation started to block.InterruptedIOException
Copyright © 2014. All Rights Reserved.