public class SocketInput extends Object implements CommunicationsInput
| Modifier and Type | Field and Description |
|---|---|
private InputStream |
bufferedIn |
private ByteCountingInputStream |
countingIn |
private InterruptableInputStream |
interruptableIn |
private static org.slf4j.Logger |
LOG |
private Socket |
socket |
private InputStream |
socketIn |
| Constructor and Description |
|---|
SocketInput(Socket socket) |
| Modifier and Type | Method and Description |
|---|---|
void |
consume()
Reads all data currently on the socket and throws it away
|
long |
getBytesRead() |
InputStream |
getInputStream() |
void |
interrupt() |
boolean |
isDataAvailable() |
void |
setTimeout(int millis) |
private static final org.slf4j.Logger LOG
private final Socket socket
private final InputStream socketIn
private final ByteCountingInputStream countingIn
private final InputStream bufferedIn
private final InterruptableInputStream interruptableIn
public SocketInput(Socket socket) throws IOException
IOExceptionpublic InputStream getInputStream() throws IOException
getInputStream in interface CommunicationsInputIOExceptionpublic void setTimeout(int millis)
public boolean isDataAvailable()
public long getBytesRead()
getBytesRead in interface CommunicationsInputpublic void interrupt()
public void consume()
throws IOException
CommunicationsInputconsume in interface CommunicationsInputIOException - if unable to consumeCopyright © 2023 Apache NiFi Project. All rights reserved.