--- /dev/null
+/* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */\r
+package org.opendaylight.openflowjava.protocol.impl.util;\r
+\r
+import io.netty.buffer.ByteBuf;\r
+import io.netty.buffer.UnpooledByteBufAllocator;\r
+\r
+/**\r
+ * @author michal.polkorab\r
+ *\r
+ */\r
+public abstract class BufferHelper {\r
+\r
+ /**\r
+ * \r
+ */\r
+ private static final byte[] XID = new byte[]{0x01, 0x02, 0x03, 0x04};\r
+\r
+ /**\r
+ * @param payload\r
+ * @return ByteBuf filled with OpenFlow protocol message without first 2 bytes\r
+ */\r
+ public static ByteBuf buildBuffer(byte[] payload) {\r
+ ByteBuf bb = UnpooledByteBufAllocator.DEFAULT.buffer();\r
+ bb.writeBytes(XID);\r
+ bb.writeBytes(payload);\r
+ return bb;\r
+ }\r
+\r
+}\r