public final class JsonIOUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JsonIOUtil.Factory
A custom factory simply to expose certain fields.
|
| Modifier and Type | Field and Description |
|---|---|
static JsonIOUtil.Factory |
DEFAULT_JSON_FACTORY
The default json factory for creating json parsers and generators.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> void |
mergeFrom(byte[] data,
int offset,
int length,
T message,
Schema<T> schema,
boolean numeric)
Merges the
message with the byte array using the given schema. |
static <T> void |
mergeFrom(byte[] data,
T message,
Schema<T> schema,
boolean numeric)
Merges the
message with the byte array using the given schema. |
static <T> void |
mergeFrom(InputStream in,
T message,
Schema<T> schema,
boolean numeric)
|
static <T> void |
mergeFrom(InputStream in,
T message,
Schema<T> schema,
boolean numeric,
LinkedBuffer buffer)
|
static <T> void |
mergeFrom(com.fasterxml.jackson.core.JsonParser parser,
T message,
Schema<T> schema,
boolean numeric)
Merges the
message from the JsonParser using the given schema. |
static <T> void |
mergeFrom(Reader reader,
T message,
Schema<T> schema,
boolean numeric)
|
static com.fasterxml.jackson.core.json.UTF8JsonGenerator |
newJsonGenerator(OutputStream out,
byte[] buf)
Creates a
UTF8JsonGenerator for the outputstream with the supplied buf outBuffer to use. |
static com.fasterxml.jackson.core.json.UTF8StreamJsonParser |
newJsonParser(InputStream in,
byte[] buf,
int offset,
int limit)
Creates a
UTF8StreamJsonParser from the inputstream with the supplied buf inBuffer to use. |
static Pipe |
newPipe(byte[] data,
boolean numeric)
Creates a json pipe from a byte array.
|
static Pipe |
newPipe(byte[] data,
int offset,
int length,
boolean numeric)
Creates a json pipe from a byte array.
|
static Pipe |
newPipe(InputStream in,
boolean numeric)
Creates a json pipe from an
InputStream. |
static Pipe |
newPipe(com.fasterxml.jackson.core.JsonParser parser,
boolean numeric)
Creates a json pipe from a
JsonParser. |
static Pipe |
newPipe(Reader reader,
boolean numeric)
Creates a json pipe from a
Reader. |
static <T> List<T> |
parseListFrom(InputStream in,
Schema<T> schema,
boolean numeric)
Parses the
messages from the stream using the given schema. |
static <T> List<T> |
parseListFrom(InputStream in,
Schema<T> schema,
boolean numeric,
LinkedBuffer buffer)
Parses the
messages from the stream using the given schema. |
static <T> List<T> |
parseListFrom(com.fasterxml.jackson.core.JsonParser parser,
Schema<T> schema,
boolean numeric)
Parses the
messages from the parser using the given schema. |
static <T> List<T> |
parseListFrom(Reader reader,
Schema<T> schema,
boolean numeric)
Parses the
messages from the reader using the given schema. |
static <T> byte[] |
toByteArray(T message,
Schema<T> schema,
boolean numeric)
Serializes the
message into a byte array using the given schema. |
static <T> byte[] |
toByteArray(T message,
Schema<T> schema,
boolean numeric,
LinkedBuffer buffer)
Serializes the
message into a byte array using the given schema. |
static <T> void |
writeListTo(com.fasterxml.jackson.core.JsonGenerator generator,
List<T> messages,
Schema<T> schema,
boolean numeric)
Serializes the
messages into the generator using the given schema. |
static <T> void |
writeListTo(OutputStream out,
List<T> messages,
Schema<T> schema,
boolean numeric)
Serializes the
messages into the stream using the given schema. |
static <T> void |
writeListTo(OutputStream out,
List<T> messages,
Schema<T> schema,
boolean numeric,
LinkedBuffer buffer)
Serializes the
messages into the stream using the given schema. |
static <T> void |
writeListTo(Writer writer,
List<T> messages,
Schema<T> schema,
boolean numeric)
Serializes the
messages into the writer using the given schema. |
static <T> void |
writeTo(com.fasterxml.jackson.core.JsonGenerator generator,
T message,
Schema<T> schema,
boolean numeric)
Serializes the
message into a JsonGenerator using the given schema. |
static <T> void |
writeTo(OutputStream out,
T message,
Schema<T> schema,
boolean numeric)
|
static <T> void |
writeTo(OutputStream out,
T message,
Schema<T> schema,
boolean numeric,
LinkedBuffer buffer)
|
static <T> void |
writeTo(Writer writer,
T message,
Schema<T> schema,
boolean numeric)
|
public static final JsonIOUtil.Factory DEFAULT_JSON_FACTORY
public static Pipe newPipe(byte[] data, boolean numeric) throws IOException
IOExceptionpublic static Pipe newPipe(byte[] data, int offset, int length, boolean numeric) throws IOException
IOExceptionpublic static Pipe newPipe(InputStream in, boolean numeric) throws IOException
InputStream.IOExceptionpublic static Pipe newPipe(Reader reader, boolean numeric) throws IOException
Reader.IOExceptionpublic static Pipe newPipe(com.fasterxml.jackson.core.JsonParser parser, boolean numeric) throws IOException
JsonParser.IOExceptionpublic static com.fasterxml.jackson.core.json.UTF8StreamJsonParser newJsonParser(InputStream in, byte[] buf, int offset, int limit) throws IOException
UTF8StreamJsonParser from the inputstream with the supplied buf inBuffer to use.IOExceptionpublic static com.fasterxml.jackson.core.json.UTF8JsonGenerator newJsonGenerator(OutputStream out, byte[] buf)
UTF8JsonGenerator for the outputstream with the supplied buf outBuffer to use.public static <T> void mergeFrom(byte[] data,
T message,
Schema<T> schema,
boolean numeric)
throws IOException
message with the byte array using the given schema.IOExceptionpublic static <T> void mergeFrom(byte[] data,
int offset,
int length,
T message,
Schema<T> schema,
boolean numeric)
throws IOException
message with the byte array using the given schema.IOExceptionpublic static <T> void mergeFrom(InputStream in, T message, Schema<T> schema, boolean numeric) throws IOException
IOExceptionpublic static <T> void mergeFrom(InputStream in, T message, Schema<T> schema, boolean numeric, LinkedBuffer buffer) throws IOException
message from the InputStream using the given schema.
The LinkedBuffer's internal byte array will be used when reading the message.
IOExceptionpublic static <T> void mergeFrom(Reader reader, T message, Schema<T> schema, boolean numeric) throws IOException
IOExceptionpublic static <T> void mergeFrom(com.fasterxml.jackson.core.JsonParser parser,
T message,
Schema<T> schema,
boolean numeric)
throws IOException
message from the JsonParser using the given schema.IOExceptionpublic static <T> byte[] toByteArray(T message,
Schema<T> schema,
boolean numeric)
message into a byte array using the given schema.public static <T> byte[] toByteArray(T message,
Schema<T> schema,
boolean numeric,
LinkedBuffer buffer)
message into a byte array using the given schema.
The LinkedBuffer's internal byte array will be used as the primary buffer when writing the message.
public static <T> void writeTo(OutputStream out, T message, Schema<T> schema, boolean numeric) throws IOException
IOExceptionpublic static <T> void writeTo(OutputStream out, T message, Schema<T> schema, boolean numeric, LinkedBuffer buffer) throws IOException
message into an OutputStream using the given schema.
The LinkedBuffer's internal byte array will be used as the primary buffer when writing the message.
IOExceptionpublic static <T> void writeTo(Writer writer, T message, Schema<T> schema, boolean numeric) throws IOException
IOExceptionpublic static <T> void writeTo(com.fasterxml.jackson.core.JsonGenerator generator,
T message,
Schema<T> schema,
boolean numeric)
throws IOException
message into a JsonGenerator using the given schema.IOExceptionpublic static <T> void writeListTo(OutputStream out, List<T> messages, Schema<T> schema, boolean numeric) throws IOException
messages into the stream using the given schema.IOExceptionpublic static <T> void writeListTo(OutputStream out, List<T> messages, Schema<T> schema, boolean numeric, LinkedBuffer buffer) throws IOException
messages into the stream using the given schema.
The LinkedBuffer's internal byte array will be used as the primary buffer when writing the message.
IOExceptionpublic static <T> void writeListTo(Writer writer, List<T> messages, Schema<T> schema, boolean numeric) throws IOException
messages into the writer using the given schema.IOExceptionpublic static <T> void writeListTo(com.fasterxml.jackson.core.JsonGenerator generator,
List<T> messages,
Schema<T> schema,
boolean numeric)
throws IOException
messages into the generator using the given schema.IOExceptionpublic static <T> List<T> parseListFrom(InputStream in, Schema<T> schema, boolean numeric) throws IOException
messages from the stream using the given schema.IOExceptionpublic static <T> List<T> parseListFrom(InputStream in, Schema<T> schema, boolean numeric, LinkedBuffer buffer) throws IOException
messages from the stream using the given schema.
The LinkedBuffer's internal byte array will be used when reading the message.
IOExceptionpublic static <T> List<T> parseListFrom(Reader reader, Schema<T> schema, boolean numeric) throws IOException
messages from the reader using the given schema.IOExceptionpublic static <T> List<T> parseListFrom(com.fasterxml.jackson.core.JsonParser parser, Schema<T> schema, boolean numeric) throws IOException
messages from the parser using the given schema.IOExceptionCopyright © 2009–2016. All rights reserved.