### Question:
ErrorPacket extends AbstractPacket { @Override public void fromByteBuf(final ByteBuf data) { this.fieldCount = DataTypesCodec.readUnsignedInt1(data); this.errorNumber = DataTypesCodec.readUnsignedInt2LE(data); this.sqlStateMarker = DataTypesCodec.readUnsignedInt1(data); this.sqlState = DataTypesCodec.readBytes(5, 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(0x80); byteBuf.writeShortLE(Short.MIN_VALUE); byteBuf.writeByte(0x80); byteBuf.writeBytes(new byte[5]); byteBuf.writeBytes("test message".getBytes()); ErrorPacket actual = new ErrorPacket(); actual.fromByteBuf(byteBuf); assertThat(actual.getFieldCount(), is((short) 128)); assertThat(actual.getErrorNumber(), is(32768)); assertThat(actual.getSqlStateMarker(), is((short) 128)); assertThat(actual.getSqlState(), is(new byte[5])); assertThat(actual.getMessage(), is("test message")); }