@Test
public void testIO() throws IOException {

  TypedBytesWritable tbw = new TypedBytesWritable();
  tbw.setValue(12345);
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  DataOutput dout = new DataOutputStream(baos);
  tbw.write(dout);
  ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
  DataInput din = new DataInputStream(bais);
  TypedBytesWritable readTbw = new TypedBytesWritable();
  readTbw.readFields(din);
  assertEquals(tbw, readTbw);
}