org.springframework.integration.ip.tcp
Class SocketMessageMapper

java.lang.Object
  extended by org.springframework.integration.ip.tcp.SocketMessageMapper
All Implemented Interfaces:
InboundMessageMapper<SocketReader>, OutboundMessageMapper<byte[]>

public class SocketMessageMapper
extends java.lang.Object
implements InboundMessageMapper<SocketReader>, OutboundMessageMapper<byte[]>

Maps incoming data from a SocketReader to a Message and from a Message to outgoing data forwarded to a SocketWriter.

Author:
Gary Russell

Constructor Summary
SocketMessageMapper()
           
 
Method Summary
 byte[] fromMessage(Message<?> message)
           
 void setCharset(java.lang.String charset)
           
 Message<byte[]> toMessage(SocketReader socketReader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketMessageMapper

public SocketMessageMapper()
Method Detail

toMessage

public Message<byte[]> toMessage(SocketReader socketReader)
                          throws java.lang.Exception
Specified by:
toMessage in interface InboundMessageMapper<SocketReader>
Throws:
java.lang.Exception

fromMessage

public byte[] fromMessage(Message<?> message)
                   throws java.lang.Exception
Specified by:
fromMessage in interface OutboundMessageMapper<byte[]>
Throws:
java.lang.Exception

setCharset

public void setCharset(java.lang.String charset)
Parameters:
charset - the charset to set