DataTypeUtil { static void revisionVectorToBuffer(RevisionVector rv, WriteBuffer buffer) { buffer.putVarInt(rv.getDimensions()); for (Revision r : rv) { buffer.putLong(r.getTimestamp()); buffer.putVarInt(r.getCounter()); buffer.putVarInt(r.getClusterId()); booleanToBuffer(r.isBranch(), buffer); } }    }
@Test public void revisionVectorToBuffer() { RevisionVector revisions = RevisionVector.fromString("r9-0-1,br7-0-2"); DataTypeUtil.revisionVectorToBuffer(revisions, wb); ByteBuffer rb = readBufferFrom(wb); assertEquals(revisions, DataTypeUtil.revisionVectorFromBuffer(rb)); }