|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.backsource.utils.io.ByteCachedStream
org.backsource.utils.io.DOMCachedStream
A StreamCache that caches data in a DOM Document.
It is important to notice that the streams returned by this class will onky work if given valid XML as data. The cached stream classes used by this cache uses DOMInputStream and DOMOutputStream so any thing valid for them is also vallid from streams achived from this cache.
| Constructor Summary | |
DOMCachedStream()
|
|
| Method Summary | |
CachedInputStream |
getInputStream(CachedOutputStream cout)
Get a rewindable input stream from the given CachedOutputStream. |
CachedInputStream |
getInputStream(org.w3c.dom.Document doc)
A DOM specific method that returns a stream configured with any properties set on this CachedStream. |
CachedOutputStream |
getOutputStream()
Get a CachedOutputStream that will write to a DOM tree. |
java.lang.String |
getProperty(java.lang.String name)
Chech if property is set. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Set a property,see DOMInputStream for the possible properties. |
| Methods inherited from class org.backsource.utils.io.ByteCachedStream |
getInputStream, rewind |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DOMCachedStream()
| Method Detail |
public CachedOutputStream getOutputStream()
throws java.io.IOException
The typical usecase for this is to later use it to get a CachedInputStream from it, it is also possible to get the DOM Document from it by using the getSink() method:
CachedOutputStream cos = cache.getOutputStream();
//Write to it
if ( cos instanceof DOMCachedOutputStream) {
Document doc = (Document)cos.getSink();
} // end of if ()
getOutputStream in interface CachedStreamgetOutputStream in class ByteCachedStreamjava.io.IOException
public CachedInputStream getInputStream(CachedOutputStream cout)
throws java.io.IOException
getInputStream in interface CachedStreamgetInputStream in class ByteCachedStreamjava.io.IOException - of the CachedOutputStream was not a DOMCachedOutputStream.
public CachedInputStream getInputStream(org.w3c.dom.Document doc)
throws java.io.IOException
java.io.IOException
public void setProperty(java.lang.String name,
java.lang.String value)
DOMInputStream for the possible properties.
setProperty in interface CachedStreamsetProperty in class ByteCachedStreampublic java.lang.String getProperty(java.lang.String name)
getProperty in interface CachedStreamgetProperty in class ByteCachedStream
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||