public long write(DataOutput out) throws IOException
{
assert !closed;
DataOutputBuffer clockOut = new DataOutputBuffer();
ColumnFamily.serializer().serializeCFInfo(emptyColumnFamily, clockOut);
long dataSize = headerBuffer.getLength() + clockOut.getLength() + columnSerializedSize;
if (logger.isDebugEnabled())
logger.debug(String.format("header / clock / column sizes are %s / %s / %s",
headerBuffer.getLength(), clockOut.getLength(), columnSerializedSize));
assert dataSize > 0;
out.writeLong(dataSize);
out.write(headerBuffer.getData(), 0, headerBuffer.getLength());
out.write(clockOut.getData(), 0, clockOut.getLength());
out.writeInt(columnCount);
Iterator<IColumn> iter = iterator();
while (iter.hasNext())
{