@Test
public void testPutWrite() {

  CKeyValue ckv = new CKeyValue(new byte[] { 0, 0, 0, 8 });
  List<CKeyValue> list = new ArrayList<CKeyValue>();
  list.add(ckv);
  Put p1 = new Put(list);
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  DataOutputStream dos = new DataOutputStream(baos);
  try {
    p1.write(dos);
  } catch (IOException e) {
    Assert.fail();
  }
  Assert.assertArrayEquals(new byte[] { 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 0, 8,
      -120, 127, -1, -1, -1, -1, -1, -1, -1 }, baos.toByteArray());
}