public void encode(OutputStream out, TransactionSnapshot snapshot) {
BinaryEncoder encoder = new BinaryEncoder(out);
try {
encoder.writeLong(snapshot.getTimestamp());
encoder.writeLong(snapshot.getReadPointer());
encoder.writeLong(snapshot.getWritePointer());
// supporting old versions of codecs
encodeObsoleteAttributes(encoder);
encodeInvalid(encoder, snapshot.getInvalid());
encodeInProgress(encoder, snapshot.getInProgress());
encodeChangeSets(encoder, snapshot.getCommittingChangeSets());