edu.rice.cs.util.swing
Class DocumentOutputStream
java.lang.Object
|
+--java.io.OutputStream
|
+--edu.rice.cs.util.swing.DocumentOutputStream
- public class DocumentOutputStream
- extends OutputStream
An extension of OutputStream
that writes its output to
an implementation of Document
.
- Version:
- $Id: DocumentOutputStream.java,v 1.4 2002/02/08 14:22:22 brianstoler Exp $
Method Summary |
void |
write(byte[] b,
int off,
int len)
Write an array of characters (bytes) to the stream at a particular offset. |
void |
write(int c)
Write a character to the stream. |
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, 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)
- Write a character to the stream.
- Overrides:
write
in class OutputStream
- Parameters:
c
- the ASCII value of the character to write.
write
public void write(byte[] b,
int off,
int len)
- Write 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