document.setClassNameIfExists(className);
int last = 0;
String field;
while (true) {
OGlobalProperty prop = null;
final int len = OVarIntSerializer.readAsInteger(bytes);
if (len == 0)
break;
else if (len > 0) {
final String res = new String(bytes.bytes, bytes.offset, len, utf8);
bytes.skip(len);
field = res;
} else {
ODatabaseRecord db = document.getDatabase();
if (db == null || db.isClosed())
throw new ODatabaseException("Impossible deserialize the document no database present");
prop = db.getMetadata().getSchema().getGlobalPropertyById((len * -1) - 1);
field = prop.getName();
}
if (document.containsField(field)) {
// SKIP FIELD
if (prop != null && prop.getType() != OType.ANY)
bytes.skip(OIntegerSerializer.INT_SIZE);
else
bytes.skip(OIntegerSerializer.INT_SIZE + 1);
continue;
}
final int valuePos = readInteger(bytes);
final OType type;
if (prop != null && prop.getType() != OType.ANY)
type = prop.getType();
else
type = readOType(bytes);
if (valuePos != 0) {
int headerCursor = bytes.offset;