1 /* Copyright (C)2013 Pantheon Technologies, s.r.o. All rights reserved. */
\r
2 package org.openflow.lib.util;
\r
4 import io.netty.buffer.ByteBuf;
\r
5 import io.netty.buffer.UnpooledByteBufAllocator;
\r
8 * @author michal.polkorab
\r
11 public abstract class BufferHelper {
\r
16 private static final byte[] XID = new byte[]{0x01, 0x02, 0x03, 0x04};
\r
20 * @return ByteBuf filled with OpenFlow protocol message without first 2 bytes
\r
22 public static ByteBuf buildBuffer(byte[] payload) {
\r
23 ByteBuf bb = UnpooledByteBufAllocator.DEFAULT.buffer();
\r
25 bb.writeBytes(payload);
\r