|
Mp3dings 20100427 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.OutputStream
de.mospace.swing.text.DocumentOutputStream
public class DocumentOutputStream
An OutputStream that writes to the Document of a Swing text component.
| Constructor Summary | |
|---|---|
DocumentOutputStream(Document d)
Constructs a new DocumentOutputStream that uses the default system charset for decoding bytes passed to its write methods. |
|
DocumentOutputStream(Document d,
Charset c)
Creates a new DocumentOutputStream that uses the specified charset for decoding bytes passed to its write methods. |
|
DocumentOutputStream(Document d,
String charsetName)
Creates a new DocumentOutputStream that uses the charset with the specified name for decoding bytes passed to its write methods. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the output stream. |
Charset |
getCharset()
Returns the character set that this DocumentOutputStream uses to write bytes to its document. |
String |
getCharsetName()
Returns the character set that this DocumentOutputStream uses to write bytes to its document. |
Document |
getDocument()
Returns the document that this OutputStream writes to. |
void |
setCharset(Charset c)
Sets the character set used for decoding bytes passed to the write methods of this DocumentOutputStream. |
void |
setCharset(String name)
Sets the character set used for decoding bytes passed to the write methods of this DocumentOutputStream. |
void |
setColor(Color c)
Sets the foreground color for new output. |
void |
setDocument(Document d)
Sets the document that this OutputStream writes to. |
void |
write(byte[] b)
Inserts the specified bytes at the end of the current document of this DocumentOutputStream. |
void |
write(byte[] b,
int off,
int len)
Inserts the specified bytes at the end of the current document of this DocumentOutputStream. |
void |
write(int b)
Inserts the specified byte at the end of the current document of this DocumentOutputStream. |
| Methods inherited from class java.io.OutputStream |
|---|
flush |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DocumentOutputStream(Document d)
d - the document that this output stream will write to
NullPointerException - if d is null
public DocumentOutputStream(Document d,
Charset c)
d - the document that this output stream will write toc - charset for decoding bytes passed to one of the write methods
NullPointerException - if one of the parameters is null
public DocumentOutputStream(Document d,
String charsetName)
d - the document that this output stream will write tocharsetName - the name of a charset to use
NullPointerException - if one of the parameters is null
UnsupportedCharsetException - if the JVM does
not support the charset with the specified name| Method Detail |
|---|
public void setColor(Color c)
c - the new text colorpublic void setCharset(String name)
name - charset for decoding bytes
NullPointerException - if name is null
UnsupportedCharsetException - if the JVM does
not support the charset with the specified namepublic void setCharset(Charset c)
c - charset for decoding bytes
NullPointerException - if c is nullpublic Charset getCharset()
null if this stream has been closedpublic String getCharsetName()
null if this stream has been closedpublic void setDocument(Document d)
d - the document that this output stream will write to
NullPointerException - if d is nullpublic Document getDocument()
null if this stream has been closedpublic void close()
close in interface Closeableclose in class OutputStream
public void write(int b)
throws IOException
b is converted to a unicode
character by calling the decode method of the
current charset of this DocumentOutputStream.
write in class OutputStreamb - the byte to write
IOException - if the output stream has been closed
public void write(byte[] b)
throws IOException
b is converted to a unicode string
by calling the decode method of the current
charset of this DocumentOutputStream.
write(b) has exactly the same effect as the call
write(b, 0, b.length).
write in class OutputStreamb - the byte to write
IOException - if the output stream has been closedwrite(byte[], int, int)
public void write(byte[] b,
int off,
int len)
throws IOException
b is converted to a unicode string
by calling the decode method of the current
charset of this DocumentOutputStream.
write in class OutputStreamb - the dataoff - the start offset in the datalen - the number of bytes to write
IOException - if the output stream has been closed
NullPointerException - if b is null
IndexOutOfBoundsException - if the preconditions on the off
and len parameters do not hold
|
Mp3dings 20100427 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||