public class JsonCodec extends Object
| Constructor and Description |
|---|
JsonCodec() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
convert(Object obj,
Class<T> clazz) |
static <T> T |
read(byte[] bytes,
Class<T> clazz) |
static <T> T |
read(byte[] bytes,
int offset,
int len,
Class<T> clazz) |
static <T> T |
read(InputStream inputStream,
Class<T> clazz) |
static <T> T |
read(com.fasterxml.jackson.core.JsonParser parser,
Class<T> clazz) |
static <T> T |
read(String aString,
Class<T> clazz) |
static byte[] |
writeAsBytes(Object obj) |
static com.fasterxml.jackson.databind.node.ObjectNode |
writeAsObjectNode(Object obj) |
static String |
writeAsString(Object obj) |
static void |
writeToStream(OutputStream outputStream,
Object obj) |
public static <T> T read(byte[] bytes,
Class<T> clazz)
throws IOException
IOExceptionpublic static <T> T read(byte[] bytes,
int offset,
int len,
Class<T> clazz)
throws IOException
IOExceptionpublic static <T> T read(String aString, Class<T> clazz) throws IOException
IOExceptionpublic static <T> T read(InputStream inputStream, Class<T> clazz) throws IOException
IOExceptionpublic static <T> T read(com.fasterxml.jackson.core.JsonParser parser,
Class<T> clazz)
throws IOException
IOExceptionpublic static com.fasterxml.jackson.databind.node.ObjectNode writeAsObjectNode(Object obj) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic static byte[] writeAsBytes(Object obj) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic static String writeAsString(Object obj) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic static void writeToStream(OutputStream outputStream, Object obj) throws IOException
IOExceptionCopyright © 2016. All rights reserved.