Optimize usage of PacketBuffer.