}
public void readFields(DataInput in) throws IOException {
kvs.clear();
scopes.clear();
Decoder decoder = this.codec.getDecoder((DataInputStream) in);
int versionOrLength = in.readInt();
int length = versionOrLength;
// make sure we get the real length
if (versionOrLength == VERSION_2) {
length = in.readInt();
}
// read in all the key values
kvs.ensureCapacity(length);
for(int i=0; i< length && decoder.advance(); i++) {
kvs.add(decoder.current());
}
//its a new style WAL, so we need replication scopes too
if (versionOrLength == VERSION_2) {
int numEntries = in.readInt();