com.ximpleware.extended
Class XMLBuffer

java.lang.Object
  extended by com.ximpleware.extended.XMLBuffer
All Implemented Interfaces:
com.ximpleware.extended.IByteBuffer

public class XMLBuffer
extends java.lang.Object
implements com.ximpleware.extended.IByteBuffer

XMLBuffer is a class that reads in an XML doc into chunk-based memory buffers the file size is equal to n*1GB + m (where m < 1GB)


Constructor Summary
XMLBuffer()
           
XMLBuffer(byte[] ba)
           
 
Method Summary
 byte byteAt(long index)
          Get the byte at the given index of the underlying byte storage.
 byte[] getBytes()
           
 byte[] getBytes(int offset, int len)
          Return a byte array filled with content from underlying byte storage.
 long length()
          Total size in terms of # of bytes.
 void readFile(java.lang.String fileName)
           
 void writeToFileOutputStream(java.io.FileOutputStream ost, long os, long len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLBuffer

public XMLBuffer()

XMLBuffer

public XMLBuffer(byte[] ba)
Method Detail

byteAt

public final byte byteAt(long index)
Description copied from interface: com.ximpleware.extended.IByteBuffer
Get the byte at the given index of the underlying byte storage.

Specified by:
byteAt in interface com.ximpleware.extended.IByteBuffer
Returns:
byte

getBytes

public byte[] getBytes()
Specified by:
getBytes in interface com.ximpleware.extended.IByteBuffer

getBytes

public byte[] getBytes(int offset,
                       int len)
Return a byte array filled with content from underlying byte storage.

Specified by:
getBytes in interface com.ximpleware.extended.IByteBuffer
Parameters:
offset - int bytes offset (not UTF char unit)
len - int
Returns:
byte[]

length

public long length()
Total size in terms of # of bytes.

Specified by:
length in interface com.ximpleware.extended.IByteBuffer
Returns:
int

readFile

public void readFile(java.lang.String fileName)
              throws java.io.IOException,
                     ParseExceptionHuge
Parameters:
fileName -
Throws:
java.io.IOException
ParseException
ParseExceptionHuge

writeToFileOutputStream

public void writeToFileOutputStream(java.io.FileOutputStream ost,
                                    long os,
                                    long len)
                             throws java.io.IOException
Specified by:
writeToFileOutputStream in interface com.ximpleware.extended.IByteBuffer
Throws:
java.io.IOException