@Test public void testBinaryKeyInNestedObject() throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); MessagePacker packer = MessagePack.newDefaultPacker(out); packer.packArrayHeader(2); packer.packMapHeader(1); byte[] bytes = "bar".getBytes(); packer.packBinaryHeader(bytes.length); packer.writePayload(bytes); packer.packInt(12); packer.packInt(1); packer.close(); ObjectMapper mapper = new ObjectMapper(new MessagePackFactory()); List<Object> objects = mapper.readValue(out.toByteArray(), new TypeReference<List<Object>>() {}); assertEquals(2, objects.size()); @SuppressWarnings(value = "unchecked") Map<String, Object> map = (Map<String, Object>) objects.get(0); assertEquals(1, map.size()); assertEquals(12, map.get("bar")); assertEquals(1, objects.get(1)); }
@Override public void close() throws IOException { try { if (isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE)) { MessageUnpacker messageUnpacker = getMessageUnpacker(); messageUnpacker.close(); } } finally { isClosed = true; } }
MessagePackParser extends ParserMinimalBase { @Override public void close() throws IOException { try { if (isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE)) { MessageUnpacker messageUnpacker = getMessageUnpacker(); messageUnpacker.close(); } } finally { isClosed = true; } } }
MessagePackParser extends ParserMinimalBase { @Override public void close() throws IOException { try { if (isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE)) { MessageUnpacker messageUnpacker = getMessageUnpacker(); messageUnpacker.close(); } } finally { isClosed = true; } } MessagePackParser(IOContext ctxt, int features, ObjectCodec objectCodec, InputStream in);  MessagePackParser(
            IOContext ctxt,
            int features,
            ObjectCodec objectCodec,
            InputStream in,
            boolean reuseResourceInParser);  MessagePackParser(IOContext ctxt, int features, ObjectCodec objectCodec, byte[] bytes);  MessagePackParser(
            IOContext ctxt,
            int features,
            ObjectCodec objectCodec,
            byte[] bytes,
            boolean reuseResourceInParser); private  MessagePackParser(IOContext ctxt,
            int features,
            MessageBufferInput input,
            ObjectCodec objectCodec,
            Object src,
            boolean reuseResourceInParser); }
MessagePackParser extends ParserMinimalBase { @Override public void close() throws IOException { try { if (isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE)) { MessageUnpacker messageUnpacker = getMessageUnpacker(); messageUnpacker.close(); } } finally { isClosed = true; } } MessagePackParser(IOContext ctxt, int features, ObjectCodec objectCodec, InputStream in);  MessagePackParser(
            IOContext ctxt,
            int features,
            ObjectCodec objectCodec,
            InputStream in,
            boolean reuseResourceInParser);  MessagePackParser(IOContext ctxt, int features, ObjectCodec objectCodec, byte[] bytes);  MessagePackParser(
            IOContext ctxt,
            int features,
            ObjectCodec objectCodec,
            byte[] bytes,
            boolean reuseResourceInParser); private  MessagePackParser(IOContext ctxt,
            int features,
            MessageBufferInput input,
            ObjectCodec objectCodec,
            Object src,
            boolean reuseResourceInParser); void setExtensionTypeCustomDeserializers(ExtensionTypeCustomDeserializers extTypeCustomDesers); @Override ObjectCodec getCodec(); @Override void setCodec(ObjectCodec c); @Override Version version(); @Override JsonToken nextToken(); @Override String getText(); @Override char[] getTextCharacters(); @Override boolean hasTextCharacters(); @Override int getTextLength(); @Override int getTextOffset(); @Override byte[] getBinaryValue(Base64Variant b64variant); @Override Number getNumberValue(); @Override int getIntValue(); @Override long getLongValue(); @Override BigInteger getBigIntegerValue(); @Override float getFloatValue(); @Override double getDoubleValue(); @Override BigDecimal getDecimalValue(); @Override Object getEmbeddedObject(); @Override NumberType getNumberType(); @Override void close(); @Override boolean isClosed(); @Override JsonStreamContext getParsingContext(); @Override JsonLocation getTokenLocation(); @Override JsonLocation getCurrentLocation(); @Override void overrideCurrentName(String name); @Override String getCurrentName(); }
MessagePackParser extends ParserMinimalBase { @Override public void close() throws IOException { try { if (isEnabled(JsonParser.Feature.AUTO_CLOSE_SOURCE)) { MessageUnpacker messageUnpacker = getMessageUnpacker(); messageUnpacker.close(); } } finally { isClosed = true; } } MessagePackParser(IOContext ctxt, int features, ObjectCodec objectCodec, InputStream in);  MessagePackParser(
            IOContext ctxt,
            int features,
            ObjectCodec objectCodec,
            InputStream in,
            boolean reuseResourceInParser);  MessagePackParser(IOContext ctxt, int features, ObjectCodec objectCodec, byte[] bytes);  MessagePackParser(
            IOContext ctxt,
            int features,
            ObjectCodec objectCodec,
            byte[] bytes,
            boolean reuseResourceInParser); private  MessagePackParser(IOContext ctxt,
            int features,
            MessageBufferInput input,
            ObjectCodec objectCodec,
            Object src,
            boolean reuseResourceInParser); void setExtensionTypeCustomDeserializers(ExtensionTypeCustomDeserializers extTypeCustomDesers); @Override ObjectCodec getCodec(); @Override void setCodec(ObjectCodec c); @Override Version version(); @Override JsonToken nextToken(); @Override String getText(); @Override char[] getTextCharacters(); @Override boolean hasTextCharacters(); @Override int getTextLength(); @Override int getTextOffset(); @Override byte[] getBinaryValue(Base64Variant b64variant); @Override Number getNumberValue(); @Override int getIntValue(); @Override long getLongValue(); @Override BigInteger getBigIntegerValue(); @Override float getFloatValue(); @Override double getDoubleValue(); @Override BigDecimal getDecimalValue(); @Override Object getEmbeddedObject(); @Override NumberType getNumberType(); @Override void close(); @Override boolean isClosed(); @Override JsonStreamContext getParsingContext(); @Override JsonLocation getTokenLocation(); @Override JsonLocation getCurrentLocation(); @Override void overrideCurrentName(String name); @Override String getCurrentName();  }