Entry<Object, Object> values[] = new Entry[map.size()];
int fullPos = OVarIntSerializer.write(bytes, map.size());
for (Entry<Object, Object> entry : map.entrySet()) {
// TODO:check skip of complex types
// FIXME: changed to support only string key on map
OType type = OType.STRING;
writeOType(bytes, bytes.alloc(1), type);
writeString(bytes, entry.getKey().toString());
pos[i] = bytes.alloc(OIntegerSerializer.INT_SIZE + 1);
values[i] = entry;
i++;
}
for (i = 0; i < values.length; i++) {
int pointer = 0;
Object value = values[i].getValue();
if (value != null) {
OType type = getTypeFromValueEmbedded(value);
// temporary skip serialization of unknown types
if (type == null)
continue;
pointer = writeSingleValue(bytes, value, type, null);
OIntegerSerializer.INSTANCE.serializeLiteral(pointer, bytes.bytes, pos[i]);