edu.rice.cs.util.swing
Class DocumentOutputStream
java.lang.Object
java.io.OutputStream
edu.rice.cs.util.swing.DocumentOutputStream
- All Implemented Interfaces:
- Closeable, Flushable
public class DocumentOutputStream
- extends OutputStream
An extension of OutputStream that writes its output to
an implementation of Document.
- Version:
- $Id: DocumentOutputStream.java 5175 2010-01-20 08:46:32Z mgricken $
|
Method Summary |
void |
write(byte[] b,
int off,
int len)
Writes an array of characters (bytes) to the stream at a particular offset. |
void |
write(int c)
Writes a character to the stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_doc
private Document _doc
_attributes
private AttributeSet _attributes
DocumentOutputStream
public DocumentOutputStream(Document doc)
- Constructs an
OutputStream that writes its output to a Document.
When this constructor is used, all insertions to the Document will
be done with the attributes set to null.
- Parameters:
doc - Document to write output to.
DocumentOutputStream
public DocumentOutputStream(Document doc,
AttributeSet attributes)
- Constructs an
OutputStream that writes its output to a Document.
- Parameters:
doc - Document to write output to.attributes - Attributes to use for inserting text into the document that is sent to this stream.
write
public void write(int c)
- Writes a character to the stream.
- Specified by:
write in class OutputStream
- Parameters:
c - the ASCII value of the character to write.
write
public void write(byte[] b,
int off,
int len)
- Writes an array of characters (bytes) to the stream at a particular offset.
- Overrides:
write in class OutputStream
- Parameters:
b - characters to write to streamoff - start of writinglen - number of characters to write from b