Xindice API
version 1.2m1

org.apache.xindice.xml.dom
Class DOMCompressor

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended byjava.io.DataOutputStream
              extended byorg.apache.xindice.xml.XMLCompressedOutput
                  extended byorg.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) $

Field Summary
 
Fields inherited from class org.apache.xindice.xml.XMLCompressedOutput
st
 
Fields inherited from class java.io.DataOutputStream
written
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
DOMCompressor(OutputStream os, SymbolTable st)
           
 
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 org.apache.xindice.xml.XMLCompressedOutput
getSizeSize, getSizeType, writeSize, writeSize
 
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.io.FilterOutputStream
close, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.DataOutput
write
 

Constructor Detail

DOMCompressor

public DOMCompressor(OutputStream os,
                     SymbolTable st)
Method Detail

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 compress
symbols - The Symbol Table to use
Returns:
The resulting byte array

Xindice API
version 1.2m1

Copyright (c) 1999-2007 The Apache Software Foundation. All Rights Reserved.