Xindice API

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:
java.io.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.


Constructor Summary
DOMCompressor(java.io.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 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.DataOutput
write
 

Constructor Detail

DOMCompressor

public DOMCompressor(java.io.OutputStream os,
                     SymbolTable st)
Method Detail

writeNode

public void writeNode(org.w3c.dom.Node node)
               throws java.io.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:
java.io.IOException - If the write failed

Compress

public static byte[] Compress(org.w3c.dom.Node node,
                              SymbolTable symbols)
                       throws XindiceException
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
Throws:
XindiceException - if an Exception occurs

Xindice API

Copyright (c) 1999-2001 The Apache Software Foundation