public class SocketChannelInputStream extends InputStream
Modifier and Type | Field and Description |
---|---|
private Byte |
bufferedByte |
private SocketChannel |
channel |
private static long |
CHANNEL_EMPTY_WAIT_NANOS |
private ByteBuffer |
oneByteBuffer |
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() |
boolean |
isDataAvailable() |
int |
read() |
int |
read(byte[] b) |
int |
read(byte[] b,
int off,
int len) |
void |
setTimeout(int timeoutMillis) |
mark, markSupported, reset, skip
private static final long CHANNEL_EMPTY_WAIT_NANOS
private final SocketChannel channel
private volatile int timeoutMillis
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
public int available() throws IOException
available
in class InputStream
IOException
public boolean isDataAvailable() throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
- for issues closing underlying streamCopyright © 2016 Apache NiFi Project. All rights reserved.