if(tree.keySerializer!=null){
//deserialize from byte array
for(int i =0; i<keys.size(); i++){
byte[] serialized = (byte[]) keys.get(i);
if(serialized == null) continue;
K key = tree.keySerializer.deserialize(new SerializerInput(new ByteArrayInputStream(serialized)));
keys.set(i, key);
}
}
_keys = keys;
//read values
_values = new ArrayList<V>(_keys.size());
for(int i = 0;i<_keys.size();i++){
if(_keys.get(i) == null)
_values.add(null);
else if(tree.valueSerializer==null)
_values.add((V) Serialization.readObject(in));
else{
byte[] serialized = BPage.readByteArray( in );
V val = tree.valueSerializer.deserialize(new SerializerInput(new ByteArrayInputStream(serialized)));
_values.add(val);
}
}
}