public class DirectProtocol extends AbstractByteProtocol
EOFProtocol
and
LengthProtocol
may be more reliable.
Writing simply writes the data to the socket.
Modifier and Type | Field and Description |
---|---|
protected int |
bufferSize |
protected static int |
UNLIMITED |
EOF, NO_STREAM, STREAM_OK
Constructor and Description |
---|
DirectProtocol() |
DirectProtocol(boolean streamOk,
int bufferSize) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
isRepeat(int len,
int available)
Decide whether to repeat transfer.
|
Object |
read(InputStream is)
Reads the input stream and returns a whole message.
|
Object |
read(InputStream is,
int limit) |
protected int |
remaining(int limit,
int remain,
int len) |
copy, copy, createResponse, isRethrowExceptionOnRead, nullEmptyArray, safeRead, safeRead, setObjectSerializer, setRethrowExceptionOnRead, write, writeByteArray
protected static final int UNLIMITED
protected int bufferSize
public DirectProtocol()
public DirectProtocol(boolean streamOk, int bufferSize)
public Object read(InputStream is) throws IOException
TcpProtocol
is
- the input streamIOException
- if an exception occurspublic Object read(InputStream is, int limit) throws IOException
IOException
protected int remaining(int limit, int remain, int len)
protected boolean isRepeat(int len, int available)
len
- Amount transferred last call (-1 on EOF or socket error)available
- Amount availableCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.