### Question:
OkPacket extends AbstractPacket { @Override public void fromByteBuf(final ByteBuf data) { this.fieldCount = DataTypesCodec.readUnsignedInt1(data); this.affectedRows = DataTypesCodec.readLengthCodedIntLE(data); this.insertId = DataTypesCodec.readLengthCodedIntLE(data); this.serverStatus = DataTypesCodec.readUnsignedInt2LE(data); this.warningCount = DataTypesCodec.readUnsignedInt2LE(data); this.message = new String(DataTypesCodec.readBytes(data.readableBytes(), data)); }  @Override void fromByteBuf(final ByteBuf data);  }### Answer:
@Test public void assertFromByteBuf() { ByteBuf byteBuf = Unpooled.buffer(); byteBuf.writeByte(0x01); byteBuf.writeByte(0x0a); byteBuf.writeByte(0xff); byteBuf.writeShortLE(Short.MIN_VALUE); byteBuf.writeShortLE(Short.MIN_VALUE); byteBuf.writeBytes("test message".getBytes()); OkPacket actual = new OkPacket(); actual.fromByteBuf(byteBuf); assertThat(actual.getFieldCount(), is((short) 1)); assertThat(actual.getAffectedRows(), is(10L)); assertThat(actual.getInsertId(), is(255L)); assertThat(actual.getServerStatus(), is(32768)); assertThat(actual.getWarningCount(), is(32768)); assertThat(actual.getMessage(), is("test message")); }