private void packObject(StackItemForObject stackItem) throws IOException {
List<String> keys = stackItem.getKeys();
List<Object> values = stackItem.getValues();
MessagePacker messagePacker = getMessagePacker();
messagePacker.packMapHeader(keys.size());
for (int i = 0; i < keys.size(); i++) {
messagePacker.packString(keys.get(i));
Object v = values.get(i);
packValue(v);