|
Berkeley DB XML version 2.5.16 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.dbxml.XmlInputStream
public class XmlInputStream
Used to read and write XML data. You can obtain an instance of this object using one of
XmlManager.createLocalFileInputStream(java.lang.String)
,
XmlManager.createStdInInputStream()
,
XmlManager.createURLInputStream(java.lang.String, java.lang.String, java.lang.String)
,
XmlManager.createInputStream(java.io.InputStream)
, or
XmlDocument.getContentAsXmlInputStream()
.
You use instances of this class with XmlContainer.putDocument(com.sleepycat.dbxml.XmlDocument)
and
XmlDocument.setContentAsXmlInputStream(com.sleepycat.dbxml.XmlInputStream)
.
You can manually retrieve the contents of the input stream using
readBytes(byte[], long)
and curPos()
.
XmlInputStream is a pure virtual interface. It can be subclassed
by an application, and an instance passed to any of the methods
that take XmlInputStream as a parameter, such as XmlContainer.putDocument(com.sleepycat.dbxml.XmlDocument)
.
This is especially useful for streaming XML from an application directly
into Berkeley DB XML without first converting it to a string.
Constructor Summary | |
---|---|
XmlInputStream()
|
Method Summary | |
---|---|
long |
curPos()
Returns the number of bytes currently read from the beginning of the input stream. |
void |
delete()
Free the native resources associated with this object. |
long |
readBytes(byte[] toFill,
long maxToRead)
Reads maxToRead number of bytes from the input stream and
places those bytes in toFill . |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XmlInputStream()
Method Detail |
---|
public void delete()
public long curPos() throws XmlException
XmlException
public long readBytes(byte[] toFill, long maxToRead) throws XmlException
maxToRead
number of bytes from the input stream and
places those bytes in toFill
. Returns the number of bytes read,
or 0 if the end of the stream has been reached.
toFill
- A buffer used to place the bytes read from the
input stream. It is the responsibility of the programmer to ensure that
the buffer provided here is large enough for the amount of data to be
read.maxToRead
- Identifies the maximum number of bytes to read from the input stream.
XmlException
|
Berkeley DB XML version 2.5.16 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |