com.ximpleware.extended
Class XMLBuffer

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

public class XMLBuffer
extends Object
implements 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(String fileName)
           
 void writeToFileOutputStream(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

readFile

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

byteAt

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

Specified by:
byteAt in interface IByteBuffer
Returns:
byte

getBytes

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

Specified by:
getBytes in interface 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 IByteBuffer
Returns:
int

getBytes

public byte[] getBytes()
Specified by:
getBytes in interface IByteBuffer

writeToFileOutputStream

public void writeToFileOutputStream(FileOutputStream ost,
                                    long os,
                                    long len)
                             throws IOException
Specified by:
writeToFileOutputStream in interface IByteBuffer
Throws:
IOException


Copyright © 2013. All Rights Reserved.