assertEquals(pkt.getData(), pkt2.getData());
}
@Test
public void testEncodeAndDecodeWithNegativeCrc() throws Exception {
NrpePacket pkt = NrpePacket.newInstance(2, NrpePacket.QUERY_PACKET, 3, "zorka.version[]");
ByteArrayOutputStream os = new ByteArrayOutputStream(1036);
pkt.encode(os);
byte[] buf = os.toByteArray();
assertEquals(1036, buf.length);
NrpePacket pkt2 = NrpePacket.fromStream(new ByteArrayInputStream(buf));
assertEquals(pkt.getVersion(), pkt2.getVersion());
assertEquals(pkt.getType(), pkt2.getType());
assertEquals(pkt.getResultCode(), pkt2.getResultCode());
assertEquals(pkt.getData(), pkt2.getData());
}