import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.EchoReplyInput;\r
\r
/**\r
+ * Translates EchoReply messages\r
* @author michal.polkorab\r
- *\r
+ * @author timotej.kubas\r
*/\r
public class EchoReplyInputMessageFactory implements OFSerializer<EchoReplyInput>{\r
\r
public void messageToBuffer(short version, ByteBuf out,\r
EchoReplyInput message) {\r
ByteBufUtils.writeOFHeader(instance, message, out);\r
+ byte[] data = message.getData();\r
+ if (data != null) {\r
+ out.writeBytes(data);\r
+ }\r
}\r
\r
@Override\r
- public int computeLength() {\r
- return MESSAGE_LENGTH;\r
+ public int computeLength(EchoReplyInput message) {\r
+ int length = MESSAGE_LENGTH;\r
+ byte[] data = message.getData();\r
+ if (data != null) {\r
+ length += data.length;\r
+ }\r
+ return length;\r
}\r
\r
@Override\r