java.lang.Object
java.io.Reader
org.bzdev.swing.io.DocumentReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
Reader whose source is an instance of java.swing.text.Document.
Several Java APIs (e.g., the ones for printing) can get their
inputs from a Reader, but not from a Document. This class
provides a bridge between the two. The reader constructed will
not provide any style information associated with a Document.
It does, however, make it easy to print the text of a document,
which is useful for debugging and for other purposes where a
plain-text printout will suffice.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, read, ready, reset, skip, transferTo
-
Constructor Details
-
DocumentReader
Constructor.- Parameters:
doc
- the document reader's document
-
-
Method Details
-
read
- Specified by:
read
in classReader
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classReader
- Throws:
IOException
-