|
Nux 1.4 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnux.xom.io.StreamingSerializerFactory
Factory creating instances of StreamingSerializer
implementations.
Currently there are two implementations. One writes a standard textual XML
document via a thin layer on top of the normal XOM Serializer
.
The other writes a bnux binary XML document via a BinaryXMLCodec
.
Future releases may include implementations that delegate to SAX and STAX
(Actually, the STAX impl is already included, but is currently disabled as
it needs more testing.)
Constructor Summary | |
StreamingSerializerFactory()
Constructs a new factory instance; The serializer instances it creates can be reused serially, but are not thread safe. |
Method Summary | |
StreamingSerializer |
createBinaryXMLSerializer(OutputStream out,
int zlibCompressionLevel)
Returns a new streaming serializer that writes bnux binary XML to the given underlying output stream, using the given ZLIB compression level. |
StreamingSerializer |
createXMLSerializer(OutputStream out,
String encoding)
Returns a new streaming serializer that writes standard textual XML to the given underlying output stream, using the given character encoding for char to byte conversions. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StreamingSerializerFactory()
Method Detail |
public StreamingSerializer createBinaryXMLSerializer(OutputStream out, int zlibCompressionLevel)
An optional zlib compression level ranging from 0 (no ZLIB compression; best performance) to 1 (little ZLIB compression; reduced performance) to 9 (strongest ZLIB compression; worst performance) allows one to configure the CPU/memory consumption trade-off.
Unless there is a good reason to the contrary, you should always use level 0: the bnux algorithm typically already precompresses considerably.
out
- the underlying output stream to write tozlibCompressionLevel
- a number in the range 0..9
public StreamingSerializer createXMLSerializer(OutputStream out, String encoding)
The standard XOM Serializer
options are used, in
particular Serializer.setIndent(int)
with argument zero,
i.e. no extra indentation.
out
- the underlying stream to write toencoding
- the character encoding to use (e.g. "UTF-8")Serializer.Serializer(OutputStream, String)
|
Nux 1.4 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |