List of usage examples for com.fasterxml.jackson.dataformat.cbor CBORGenerator writeObject
@Override public void writeObject(Object value) throws IOException, JsonProcessingException
From source file:com.pushtechnology.diffusion.examples.ControlClientUpdatingJSONTopics.java
/** * Convert a given map to a JSON object. *//*from www . ja v a 2 s.c om*/ private JSON mapToJSON(Map<String, String> values) throws IOException { // Use the third-party Jackson library to write out the values map as a // CBOR-format binary. final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final CBORGenerator generator = cborFactory.createGenerator(baos); generator.writeObject(values); return jsonDataType.readValue(baos.toByteArray()); }