public class JslipcChannelInputStream extends InputStream implements TimeoutAware
ReadableJslipcByteChannel
in order to provide a blocking InputStream.Constructor and Description |
---|
JslipcChannelInputStream(ReadableJslipcByteChannel channel)
Creates a JslipcChannelInputStream based on the underlying channel.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
getTimeout() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
protected int |
readBlocking(ByteBuffer buffer) |
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.
|
available, mark, markSupported, read, reset, skip
public JslipcChannelInputStream(ReadableJslipcByteChannel channel)
channel
- public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
public int read() 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 readBlocking(ByteBuffer buffer) throws IOException, InterruptedIOException
IOException
InterruptedIOException
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.