|
Berkeley DB XML version 2.0.7 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.dbxml.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)
,
or XmlDocument.getContentAsXmlInputStream()
.
You use instances of this class with XmlContainer.putDocument(com.sleepycat.dbxml.XmlDocument, com.sleepycat.dbxml.XmlUpdateContext)
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. In C++, you can subclass
XmlInputStream, and pass an instance of your class to any of the methods
that take it as a parameter, such as XmlContainer.putDocument(com.sleepycat.dbxml.XmlDocument, com.sleepycat.dbxml.XmlUpdateContext)
.
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
- Specifies a pointer to 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.0.7 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |