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, skipprivate 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
IOExceptionpublic void setTimeout(int timeoutMillis)
public void consume()
throws IOException
IOExceptionpublic int read()
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b)
throws IOException
read in class InputStreamIOExceptionpublic int read(byte[] b,
int off,
int len)
throws IOException
read in class InputStreamIOExceptionpublic int available()
throws IOException
available in class InputStreamIOExceptionpublic boolean isDataAvailable()
throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class InputStreamIOException - for issues closing underlying streamCopyright © 2019 Apache NiFi Project. All rights reserved.