org.mule.providers.tcp
Interface TcpProtocol

All Known Implementing Classes:
ByteProtocol, DefaultProtocol, EOFProtocol, LengthProtocol, MuleMessageEOFProtocol, MuleMessageLengthProtocol, MuleMessageProtocol, XmlMessageEOFProtocol, XmlMessageProtocol

public interface TcpProtocol

The TcpProtocol interface enables to plug different application level protocols on a TcpConnector. Note that this interface has lost the direct byte array write method. Standard callers should (and will, since it matches the same signature, which is why the method has not been deprecated) use the generic method instead. For more complex use, the method remains as an implementation detail in ByteProtocol.writeByteArray(java.io.OutputStream, byte[]).


Method Summary
 Object read(InputStream is)
          Reads the input stream and returns a whole message.
 void write(OutputStream os, Object data)
          Write the specified message to the output stream.
 

Method Detail

read

Object read(InputStream is)
            throws IOException
Reads the input stream and returns a whole message.

Parameters:
is - the input stream
Returns:
an array of byte containing a full message
Throws:
IOException - if an exception occurs

write

void write(OutputStream os,
           Object data)
           throws IOException
Write the specified message to the output stream.

Parameters:
os - the output stream to write to
data - the data to write
Throws:
IOException - if an exception occurs


Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.