Package org.apache.juneau.marshaller
Class MsgPack
java.lang.Object
org.apache.juneau.marshaller.Marshaller
org.apache.juneau.marshaller.StreamMarshaller
org.apache.juneau.marshaller.MsgPack
A pairing of a 
MsgPackSerializer and MsgPackParser into a single class with convenience read/write methods.
 The general idea is to combine a single serializer and parser inside a simplified API for reading and writing POJOs.
Examples:
   
   
See Also:
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic byte[]Serializes a Java object to a JSON string.static ObjectSerializes a Java object to an output.static <T> TParses a JSON input string to the specified type.static <T> TParses a JSON input string to the specified Java type.static <T> TParses a JSON input object to the specified Java type.static <T> TParses a JSON input object to the specified Java type.Methods inherited from class org.apache.juneau.marshaller.StreamMarshallerread, read, writeMethods inherited from class org.apache.juneau.marshaller.MarshallergetParser, getSerializer, read, read, write
- 
Field Details- 
DEFAULTDefault reusable instance.
 
- 
- 
Constructor Details- 
MsgPackConstructor.- Parameters:
- s- The serializer to use for serializing output.
 Must not be- null .
- p- The parser to use for parsing input.
 Must not be- null .
 
- 
MsgPackpublic MsgPack()Constructor.
 
- 
- 
Method Details- 
toParses a JSON input string to the specified type.A shortcut for calling DEFAULT .read(input ,type )- Type Parameters:
- T- The class type of the object being created.
- Parameters:
- input- The input.
- type- The object type to create.
- Returns:
- The parsed object.
- Throws:
- ParseException- Malformed input encountered.
 
- 
toParses a JSON input object to the specified Java type.A shortcut for calling DEFAULT .read(input ,type )- Type Parameters:
- T- The class type of the object being created.
- Parameters:
- input- The input.
 Can be any of the following types:- null 
- InputStream
- byte []
- File
- CharSequencecontaining encoded bytes according to the- InputStreamParser.Builder.binaryFormat(BinaryFormat)setting.
 
- type- The object type to create.
- Returns:
- The parsed object.
- Throws:
- ParseException- Malformed input encountered.
- IOException- Thrown by underlying stream.
 
- 
toParses a JSON input string to the specified Java type.A shortcut for calling DEFAULT .read(input ,type ,args )- Type Parameters:
- T- The class type of the object to create.
- Parameters:
- input- The input.
- type- The object type to create.
 Can be any of the following:- ClassMeta,- Class,- ParameterizedType,- GenericArrayType
- args- The type arguments of the class if it's a collection or map.
 Can be any of the following:- ClassMeta,- Class,- ParameterizedType,- GenericArrayType
 Ignored if the main type is not a map or collection.
- Returns:
- The parsed object.
- Throws:
- ParseException- Malformed input encountered.
- See Also:
 
- 
toParses a JSON input object to the specified Java type.A shortcut for calling DEFAULT .read(input ,type ,args )- Type Parameters:
- T- The class type of the object to create.
- Parameters:
- input- The input.
 Can be any of the following types:- null 
- InputStream
- byte []
- File
- CharSequencecontaining encoded bytes according to the- InputStreamParser.Builder.binaryFormat(BinaryFormat)setting.
 
- type- The object type to create.
 Can be any of the following:- ClassMeta,- Class,- ParameterizedType,- GenericArrayType
- args- The type arguments of the class if it's a collection or map.
 Can be any of the following:- ClassMeta,- Class,- ParameterizedType,- GenericArrayType
 Ignored if the main type is not a map or collection.
- Returns:
- The parsed object.
- Throws:
- ParseException- Malformed input encountered.
- IOException- Thrown by underlying stream.
- See Also:
 
- 
ofSerializes a Java object to a JSON string.A shortcut for calling DEFAULT .write(object )- Parameters:
- object- The object to serialize.
- Returns:
- The serialized object.
- Throws:
- SerializeException- If a problem occurred trying to convert the output.
 
- 
ofSerializes a Java object to an output.A shortcut for calling DEFAULT .write(output )- Parameters:
- object- The object to serialize.
- output- The output object.
 Can be any of the following types:
- Returns:
- The output object.
- Throws:
- SerializeException- If a problem occurred trying to convert the output.
- IOException- Thrown by underlying stream.
 
 
-