List of usage examples for io.netty.buffer ByteBufAllocator compositeBuffer
CompositeByteBuf compositeBuffer(int maxNumComponents);
From source file:com.tesora.dve.db.mysql.portal.protocol.Packet.java
License:Open Source License
public Packet(ByteBufAllocator alloc, int expectedSequence, Modifier mod, String context) { this.expectedSequence = expectedSequence; this.modifier = mod; this.context = context; if (modifier == Modifier.HEAPCOPY_ON_READ) { header = Unpooled.buffer(4, 4).order(ByteOrder.LITTLE_ENDIAN); payload = Unpooled.compositeBuffer(50); } else {/*w w w . ja va 2s . co m*/ header = alloc.ioBuffer(4, 4).order(ByteOrder.LITTLE_ENDIAN); payload = alloc.compositeBuffer(50); } }