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, nullEmptyArray, safeRead, safeRead, write, writeByteArrayprotected static final int UNLIMITED
protected int bufferSize
public DirectProtocol()
public DirectProtocol(boolean streamOk,
int bufferSize)
public Object read(InputStream is) throws IOException
TcpProtocolis - the input streamIOException - if an exception occurspublic Object read(InputStream is, int limit) throws IOException
IOExceptionprotected 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-2012 MuleSource, Inc.. All Rights Reserved.