java.lang.Object
de.grogra.pf.io.FilterBase
de.grogra.pf.io.SAXFilterBase
de.grogra.pf.io.StreamAdapter
- All Implemented Interfaces:
DOMSource
,FileWriterSource
,Filter
,FilterSource
,InputStreamSource
,OutputStreamSource
,ReaderSource
,SAXSource
,VirtualFileWriterSource
,WriterSource
,RegistryContext
,Map
,XMLReader
public class StreamAdapter
extends SAXFilterBase
implements InputStreamSource, OutputStreamSource, ReaderSource, WriterSource, FileWriterSource, DOMSource, VirtualFileWriterSource
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.grogra.pf.io.FilterSource
FilterSource.MetaDataKey<V>
-
Field Summary
Fields inherited from class de.grogra.pf.io.SAXFilterBase
LEX_HANDLER
Fields inherited from class de.grogra.pf.io.FilterBase
item, source
Fields inherited from interface de.grogra.pf.io.FilterSource
AUTO_PROGRESS, DESTINATION_FILE, DESTINATION_URL
Fields inherited from interface de.grogra.util.Map
DEFAULT_VALUE, EMPTY_MAP
Fields inherited from interface de.grogra.pf.io.SAXSource
NAMESPACE_PREFIXES, NAMESPACES
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the data as a DOM document.boolean
getFeature
(String name) Returns a stream to obtain the data as a stream of bytes.Returns a reader to obtain the data as a stream of characters.long
length()
Returns the total number of bytes of this stream.void
parse
(ContentHandler ch, ErrorHandler eh, LexicalHandler lh, DTDHandler dh, EntityResolver er) void
setFeature
(String name, boolean value) static void
write
(OutputStreamSource src, File out) static void
write
(WriterSource src, File out) void
write
(FileSystem fs, Object out) This method writes the data toout
.void
This method writes the data toout
.void
write
(OutputStream out) This method writes the data toout
.void
This method writes the data toout
.Methods inherited from class de.grogra.pf.io.SAXFilterBase
getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getProperty, parse, parse, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setProperty
Methods inherited from class de.grogra.pf.io.FilterBase
get, getFilter, getFlavor, getImpl, getMetaData, getRegistry, getSource, getSystemId, initProgressMonitor, setFlavor, setMetaData, setMetaData, setProgress, setSystemId, toString, toURL
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface de.grogra.pf.io.FilterSource
getFilter, getFlavor, getMetaData, getSystemId, initProgressMonitor, setMetaData, setProgress
Methods inherited from interface de.grogra.pf.registry.RegistryContext
getRegistry
-
Constructor Details
-
StreamAdapter
-
-
Method Details
-
getInputStream
Description copied from interface:InputStreamSource
Returns a stream to obtain the data as a stream of bytes.- Specified by:
getInputStream
in interfaceInputStreamSource
- Returns:
- an input stream for the data
- Throws:
IOException
-
length
public long length()Description copied from interface:InputStreamSource
Returns the total number of bytes of this stream. A negative values indicates that this number is unknown.- Specified by:
length
in interfaceInputStreamSource
- Returns:
- number of bytes
-
write
Description copied from interface:OutputStreamSource
This method writes the data toout
.- Specified by:
write
in interfaceOutputStreamSource
- Parameters:
out
- the stream to which data is written- Throws:
IOException
-
getReader
Description copied from interface:ReaderSource
Returns a reader to obtain the data as a stream of characters.- Specified by:
getReader
in interfaceReaderSource
- Returns:
- a reader for the data
- Throws:
IOException
-
write
Description copied from interface:WriterSource
This method writes the data toout
.- Specified by:
write
in interfaceWriterSource
- Parameters:
out
- the writer to which data is written- Throws:
IOException
-
parse
public void parse(ContentHandler ch, ErrorHandler eh, LexicalHandler lh, DTDHandler dh, EntityResolver er) throws IOException, SAXException - Specified by:
parse
in interfaceSAXSource
- Throws:
IOException
SAXException
-
getFeature
- Specified by:
getFeature
in interfaceSAXSource
- Specified by:
getFeature
in interfaceXMLReader
- Overrides:
getFeature
in classSAXFilterBase
- Throws:
SAXNotRecognizedException
SAXNotSupportedException
-
setFeature
public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException - Specified by:
setFeature
in interfaceSAXSource
- Specified by:
setFeature
in interfaceXMLReader
- Overrides:
setFeature
in classSAXFilterBase
- Throws:
SAXNotRecognizedException
SAXNotSupportedException
-
write
Description copied from interface:FileWriterSource
This method writes the data toout
.- Specified by:
write
in interfaceFileWriterSource
- Parameters:
out
- the file to which data is written- Throws:
IOException
-
write
Description copied from interface:VirtualFileWriterSource
This method writes the data toout
.- Specified by:
write
in interfaceVirtualFileWriterSource
- Parameters:
fs
- the file system to which data is writtenout
- the file to which data is written- Throws:
IOException
-
write
- Throws:
IOException
-
write
- Throws:
IOException
-
getDocument
Description copied from interface:DOMSource
Returns the data as a DOM document.- Specified by:
getDocument
in interfaceDOMSource
- Returns:
- the data
- Throws:
IOException
DOMException
-