List of usage examples for io.netty.buffer ByteBufAllocator ioBuffer
ByteBuf ioBuffer(int initialCapacity, int maxCapacity);
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 {//from w w w. j ava2 s . c o m header = alloc.ioBuffer(4, 4).order(ByteOrder.LITTLE_ENDIAN); payload = alloc.compositeBuffer(50); } }