public class BinaryMarshaller extends Object implements Marshaller<Binary>
Binary and vice versa.FORMAT_OUTPUT| Constructor and Description |
|---|
BinaryMarshaller() |
| Modifier and Type | Method and Description |
|---|---|
void |
marshal(Binary value, OutputStream out)
Write the specified object into the given stream.
|
void |
marshalAsFragment(Binary value, OutputStream out)
Write the specified object into the given stream as a fragment.
|
Binary |
unmarshal(InputStream in)
Read an object from the specified stream.
|
public void marshal(Binary value, OutputStream out) throws IOException
Marshallermarshal in interface Marshaller<Binary>value - object to marshallout - stream to write toIOException - if an error occurs during marshallingpublic void marshalAsFragment(Binary value, OutputStream out) throws IOException
MarshallerThis method is called when marshalling collections of objects, as marshalling behavior might differ when an object is serialized directly or as element of a collection.
For example, when marshalling a collection of objects into XML, you need to ensure that the XML declaration is emmitted only once, not for each object in the collection.
In cases where there is no difference in output between fragments and full objects (JSON, for example), this method could simply delegate to Marshaller.marshal(Object, OutputStream).
marshalAsFragment in interface Marshaller<Binary>value - object to marshallout - stream to write toIOException - if an error occurs during marshallingpublic Binary unmarshal(InputStream in) throws IOException
Marshallerunmarshal in interface Marshaller<Binary>in - stream to read fromIOException - if an error occurs during unmarshalling