Here you can find the source of writeValueAsBytes(Object value)
public static byte[] writeValueAsBytes(Object value)
//package com.java2s; //License from project: Open Source License import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; public class Main { private final static ObjectMapper OBJECT_MAPPER = new ObjectMapper(); public static byte[] writeValueAsBytes(Object value) { try {/*from w w w . j a va 2 s. co m*/ return OBJECT_MAPPER.writeValueAsBytes(value); } catch (JsonProcessingException e) { throw new IllegalStateException(e); } } }