assertEquals(data.length, packet.write(data,0,data.length));
}
assertEquals(-1, packet.write(data,0,data.length));
byte buffer[] = new byte[data.length];
packet.flip();
for(int i=0; i < 10; i++) {
assertEquals(buffer.length, packet.read(buffer,0,buffer.length));
Arrays.fill(data,(byte)i);
assertEquals(buffer, data);
}