}
};
revlogHeader.serialize(sds);
if (useUncompressedData) {
sds.writeByte((byte) 'u');
dataSource.serialize(sds);
} else {
int actualCompressedLenWritten = revlogDataZip.writeCompressedData(sds);
if (actualCompressedLenWritten != compressedLen) {
throw new HgInvalidStateException(String.format("Expected %d bytes of compressed data, but actually wrote %d in %s", compressedLen, actualCompressedLenWritten, filename));