me.prettyprint.cassandra.serializers
Class FastInfosetSerializer
java.lang.Object
me.prettyprint.cassandra.serializers.AbstractSerializer<Object>
me.prettyprint.cassandra.serializers.JaxbSerializer
me.prettyprint.cassandra.serializers.FastInfosetSerializer
- All Implemented Interfaces:
- Serializer<Object>
public class FastInfosetSerializer
- extends JaxbSerializer
A serializer which performs JAXB serialization with fast infoset encoding.
Fast infoset is a binary encoding format for XML data which optimizes data
size as well as parse and serialization time. An instance of this class may
only serialize JAXB compatible objects of classes known to its configured
context.
- Author:
- shuzhang0@gmail.com
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FastInfosetSerializer
public FastInfosetSerializer(Class... serializableClasses)
- Constructor.
- Parameters:
serializableClasses
- List of classes which can be serialized by this instance. Note
that concrete classes directly referenced by any class in the list
will also be serializable through this instance.
createStreamWriter
protected XMLStreamWriter createStreamWriter(OutputStream output)
throws XMLStreamException
- Get a new XML stream writer.
- Overrides:
createStreamWriter
in class JaxbSerializer
- Parameters:
output
- An underlying OutputStream to write to.
- Returns:
- a new
XMLStreamWriter
which writes to the specified
OutputStream. The output written by this XMLStreamWriter is
understandable by XMLStreamReaders produced by
JaxbSerializer.createStreamReader(InputStream)
.
- Throws:
XMLStreamException
createStreamReader
protected XMLStreamReader createStreamReader(InputStream input)
throws XMLStreamException
- Get a new XML stream reader.
- Overrides:
createStreamReader
in class JaxbSerializer
- Parameters:
input
- the underlying InputStream to read from.
- Returns:
- a new
XmlStreamReader
which reads from the specified
InputStream. The reader can read anything written by
JaxbSerializer.createStreamWriter(OutputStream)
.
- Throws:
XMLStreamException
Copyright © 2011. All Rights Reserved.