public class DocumentOutputStream
extends java.io.OutputStream
Constructor and Description |
---|
DocumentOutputStream(javax.swing.text.Document doc)
Constructs an output stream that will output to the
given document with whatever the default attributes
are.
|
DocumentOutputStream(javax.swing.text.Document doc,
javax.swing.text.AttributeSet a)
Constructs an output stream that will output to the
given document with the given set of character attributes.
|
Modifier and Type | Method and Description |
---|---|
void |
write(byte[] b,
int off,
int len)
Writes
len bytes from the specified byte array
starting at offset off to this output stream. |
void |
write(int b)
Writes the specified byte to this output stream.
|
public DocumentOutputStream(javax.swing.text.Document doc, javax.swing.text.AttributeSet a)
doc
- the document to write to.a
- the character attributes to use for the written
text.public DocumentOutputStream(javax.swing.text.Document doc)
doc
- the document to write to.public void write(int b) throws java.io.IOException
Subclasses of OutputStream
must provide an
implementation for this method.
write
in class java.io.OutputStream
b
- the byte
.java.io.IOException
- if an I/O error occurs.public void write(byte[] b, int off, int len) throws java.io.IOException
len
bytes from the specified byte array
starting at offset off
to this output stream.
The write
method of OutputStream
calls
the write method of one argument on each of the bytes to be
written out. Subclasses are encouraged to override this method and
provide a more efficient implementation.
write
in class java.io.OutputStream
b
- the data.off
- the start offset in the data.len
- the number of bytes to write.java.io.IOException
- if an I/O error occurs.