Berkeley DB XML
version 2.5.16

com.sleepycat.dbxml
Class XmlData

java.lang.Object
  extended by com.sleepycat.dbxml.XmlData

public class XmlData
extends Object

Used by the functions XmlCompression.compress(com.sleepycat.dbxml.XmlTransaction, com.sleepycat.dbxml.XmlData, com.sleepycat.dbxml.XmlData) and XmlCompression.decompress(com.sleepycat.dbxml.XmlTransaction, com.sleepycat.dbxml.XmlData, com.sleepycat.dbxml.XmlData) to hold the data that is being compressed or decompress. It is used to store or write binary data that is to be read later.


Constructor Summary
XmlData()
           
 
Method Summary
 void adoptBuffer(XmlData src)
          Takes control of the buffer in src, leaving src empty.
 void append(byte[] data)
          Copies data onto the end of the existing data in the buffer.
 byte[] get_data()
          Returns a copy of the data in the underlying buffer.
 int get_size()
          Returns the number of bytes of the data in the buffer.
 int getReservedSize()
          Returns the size of the buffer in bytes.
 void reserve(int size)
          Allocates a buffer of size bytes.
 void set_size(int size)
          Sets the size of the data in the buffer in bytes.
 void set(byte[] data)
          Copies data into the buffer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlData

public XmlData()
Method Detail

get_data

public byte[] get_data()
Returns a copy of the data in the underlying buffer.


get_size

public int get_size()
             throws XmlException
Returns the number of bytes of the data in the buffer.

Throws:
XmlException

set_size

public void set_size(int size)
              throws XmlException
Sets the size of the data in the buffer in bytes.

Throws:
XmlException

reserve

public void reserve(int size)
             throws XmlException
Allocates a buffer of size bytes.

Throws:
XmlException

getReservedSize

public int getReservedSize()
                    throws XmlException
Returns the size of the buffer in bytes.

Throws:
XmlException

adoptBuffer

public void adoptBuffer(XmlData src)
                 throws XmlException
Takes control of the buffer in src, leaving src empty.

Throws:
XmlException

append

public void append(byte[] data)
            throws XmlException
Copies data onto the end of the existing data in the buffer.

Throws:
XmlException

set

public void set(byte[] data)
         throws XmlException
Copies data into the buffer.

Throws:
XmlException

Berkeley DB XML
version 2.5.16

Copyright (c) 1996,2009 Oracle. All rights reserved.