public class SocketChannelInputStream extends InputStream
Modifier and Type | Field and Description |
---|---|
private Byte |
bufferedByte |
private SocketChannel |
channel |
private boolean |
interrupted |
private ByteBuffer |
oneByteBuffer |
private Selector |
readSelector |
private int |
timeoutMillis |
Constructor and Description |
---|
SocketChannelInputStream(SocketChannel socketChannel) |
Modifier and Type | Method and Description |
---|---|
int |
available() |
void |
close()
Closes the underlying socket channel.
|
void |
consume() |
void |
interrupt() |
boolean |
isDataAvailable() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
setTimeout(int timeoutMillis) |
private void |
waitForReady() |
mark, markSupported, reset, skip
private final SocketChannel channel
private volatile int timeoutMillis
private volatile boolean interrupted
private final Selector readSelector
private final ByteBuffer oneByteBuffer
private Byte bufferedByte
public SocketChannelInputStream(SocketChannel socketChannel) throws IOException
IOException
public void setTimeout(int timeoutMillis)
public void consume() throws IOException
IOException
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] b) throws IOException
read
in class InputStream
IOException
public int read(byte[] b, int off, int len) throws IOException
read
in class InputStream
IOException
private void waitForReady() throws IOException
IOException
public int available() throws IOException
available
in class InputStream
IOException
public boolean isDataAvailable() throws IOException
IOException
public void interrupt()
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
- for issues closing underlying streamCopyright © 2021 Apache NiFi Project. All rights reserved.