org.apache.xindice.xml.dom
Class DOMCompressor
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
java.io.DataOutputStream
org.apache.xindice.xml.XMLCompressedOutput
org.apache.xindice.xml.dom.DOMCompressor
- All Implemented Interfaces:
- DataOutput
- public final class DOMCompressor
- extends XMLCompressedOutput
DOMCompressor is an OutputStream extension that provides functions for
writing DOM types to a Xindice Compressed XML Stream.
- Version:
- $Revision: 568786 $, $Date: 2007-08-22 20:40:57 -0400 (Wed, 22 Aug 2007) $
Method Summary |
static byte[] |
compress(org.w3c.dom.Node node,
SymbolTable symbols)
Compress is a convenience method that compresses a Node into a byte
array with a single call. |
void |
writeNode(org.w3c.dom.Node node)
writeNode writes a Node to the compressed output stream. |
Methods inherited from class java.io.DataOutputStream |
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DOMCompressor
public DOMCompressor(OutputStream os,
SymbolTable st)
writeNode
public void writeNode(org.w3c.dom.Node node)
throws IOException
- writeNode writes a Node to the compressed output stream. This method
is recursive and will write all children of the specific Node.
- Parameters:
node
- the node to write
- Throws:
IOException
- if the write to underlying stream has failed
org.w3c.dom.DOMException
- if used symbol table is read only and some of
node's content can not be serialized.
compress
public static byte[] compress(org.w3c.dom.Node node,
SymbolTable symbols)
- Compress is a convenience method that compresses a Node into a byte
array with a single call.
- Parameters:
node
- The Node to compresssymbols
- The Symbol Table to use
- Returns:
- The resulting byte array
Copyright (c) 1999-2007 The Apache Software Foundation. All Rights Reserved.