DataOutputStream da = new DataOutputStream(out);
written.write(da);
da.close();
LinkedMapWritable read = new LinkedMapWritable();
read.readFields(new DataInputStream(new FastByteArrayInputStream(out.bytes())));
assertThat(read.size(), is(written.size()));
assertThat(read.toString(), is(written.toString()));
}
}