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 $

Field Summary
private  AttributeSet _attributes
           
private  Document _doc
           
 
Constructor Summary
DocumentOutputStream(Document doc)
          Constructs an OutputStream that writes its output to a Document.
DocumentOutputStream(Document doc, AttributeSet attributes)
          Constructs an OutputStream that writes its output to a Document.
 
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.io.OutputStream
close, flush, write
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

_doc

private Document _doc

_attributes

private AttributeSet _attributes
Constructor Detail

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.
Method Detail

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 stream
off - start of writing
len - number of characters to write from b