Added code folding and formatted all files

This commit is contained in:
SuspiciousActivity committed 2018-07-08 14:39:06 +02:00
1 parent 11570d6b95
commit 66cd1dbd3e
233 files changed
+82245 -118134

No files matched your search

+50 -65
View File
@@ -1,10 +1,8 @@
/*
* 02/24/2004
*
* DocumentReader.java - A reader for javax.swing.text.Document
* objects.
*
* This library is distributed under a modified BSD license. See the included
* This library is distributed under a modified BSD license. See the included
* RSyntaxTextArea.License.txt file for details.
*/
package org.fife.io;
@@ -15,7 +13,6 @@ import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.Segment;
/**
* A <code>Reader</code> for <code>javax.swing.text.Document</code> objects.
*
@@ -23,32 +20,29 @@ import javax.swing.text.Segment;
* @version 1.0
*/
public class DocumentReader extends Reader {
/**
* The stream's position in the document.
*/
private long position;
/**
* A remembered position in the document.
*/
private long mark;
/**
* The document we're working on.
*/
private Document document;
/**
* Used for fast character access.
*/
private Segment segment;
/**
* Constructor.
*
* @param document The document we're 'reading'.
* @param document
* The document we're 'reading'.
*/
public DocumentReader(Document document) {
position = 0;
@@ -56,28 +50,25 @@ public class DocumentReader extends Reader {
this.document = document;
this.segment = new Segment();
}
/**
* This currently does nothing...
*/
@Override
public void close() {
}
public void close() {}
/**
* Marks the present position in the stream. Subsequent calls to
* Marks the present position in the stream. Subsequent calls to
* <code>reset()</code> will reposition the stream to this point.
*
* @param readAheadLimit Ignored.
* @param readAheadLimit
* Ignored.
*/
@Override
public void mark(int readAheadLimit) {
mark = position;
}
/**
* Tells whether this reader supports the <code>mark</code> operation.
* This always returns <code>true</code> for <code>DocumentReader</code>.
@@ -86,18 +77,17 @@ public class DocumentReader extends Reader {
public boolean markSupported() {
return true;
}
/**
* Reads the single character at the current position in the document.
*/
@Override
public int read() {
if(position>=document.getLength()) {
return -1; // Read past end of document.
if (position >= document.getLength()) {
return -1; // Read past end of document.
}
try {
document.getText((int)position,1, segment);
document.getText((int) position, 1, segment);
position++;
return segment.array[segment.offset];
} catch (BadLocationException ble) {
@@ -106,60 +96,59 @@ public class DocumentReader extends Reader {
return -1;
}
}
/**
* Read <code>array.length</code> characters from the beginning
* of the document into <code>array</code>.
*
* @param array The array to read characters into.
* @param array
* The array to read characters into.
* @return The number of characters read.
*/
@Override
public int read(char[] array) {
return read(array, 0, array.length);
}
/**
* Reads characters into a portion of an array.
*
* @param cbuf The destination buffer.
* @param off Offset at which to start storing characters.
* @param len Maximum number of characters to read.
* @param cbuf
* The destination buffer.
* @param off
* Offset at which to start storing characters.
* @param len
* Maximum number of characters to read.
* @return The number of characters read, or <code>-1</code> if the
* end of the stream (document) has been reached.
*/
@Override
public int read(char[] cbuf, int off, int len) {
int k;
if(position>=document.getLength()) {
return -1; // Read past end of document.
if (position >= document.getLength()) {
return -1; // Read past end of document.
}
k = len;
if((position+k)>=document.getLength()) {
k = document.getLength() - (int)position;
if ((position + k) >= document.getLength()) {
k = document.getLength() - (int) position;
}
if(off + k >= cbuf.length) {
if (off + k >= cbuf.length) {
k = cbuf.length - off;
}
try {
document.getText((int)position, k, segment);
document.getText((int) position, k, segment);
position += k;
System.arraycopy(segment.array,segment.offset,
cbuf,off,
k);
System.arraycopy(segment.array, segment.offset, cbuf, off, k);
return k;
} catch (BadLocationException ble) {
/* Should never happen ? */
return -1;
}
}
/**
* Tells whether this reader is ready to be read without
* blocking for input. <code>DocumentReader</code> will
* blocking for input. <code>DocumentReader</code> will
* always return true.
*
* @return <code>true</code> if the next read operation will
@@ -169,34 +158,32 @@ public class DocumentReader extends Reader {
public boolean ready() {
return true;
}
/**
* Resets the stream. If the stream has been marked, then attempt to
* reposition it at the mark. If the stream has not been marked, then
* Resets the stream. If the stream has been marked, then attempt to
* reposition it at the mark. If the stream has not been marked, then
* move it to the beginning of the document.
*/
@Override
public void reset() {
if(mark==-1) {
if (mark == -1) {
position = 0;
}
else {
} else {
position = mark;
mark = -1;
}
}
/**
* Skips characters. This will not 'skip' past the end of the document.
* Skips characters. This will not 'skip' past the end of the document.
*
* @param n The number of characters to skip.
* @param n
* The number of characters to skip.
* @return The number of characters actually skipped.
*/
@Override
public long skip(long n) {
if (position+n<=document.getLength()) {
if (position + n <= document.getLength()) {
position += n;
return n;
}
@@ -204,18 +191,16 @@ public class DocumentReader extends Reader {
position = document.getLength();
return document.getLength() - temp;
}
/**
* Move to the specified position in the document. If <code>pos</code>
* Move to the specified position in the document. If <code>pos</code>
* is greater than the document's length, the stream's position is moved
* to the end of the document.
*
* @param pos The position in the document to move to.
* @param pos
* The position in the document to move to.
*/
public void seek(long pos) {
position = Math.min(pos, document.getLength());
}
}
}
+96 -109
View File
@@ -1,10 +1,8 @@
/*
* 09/23/2004
*
* UnicodeReader.java - A reader for Unicode input streams that is capable of
* discerning which particular encoding is being used via the BOM.
*
* This library is distributed under a modified BSD license. See the included
* This library is distributed under a modified BSD license. See the included
* RSyntaxTextArea.License.txt file for details.
*/
package org.fife.io;
@@ -17,23 +15,24 @@ import java.io.InputStreamReader;
import java.io.PushbackInputStream;
import java.io.Reader;
/**
* A reader capable of identifying Unicode streams by their BOMs. This class
* A reader capable of identifying Unicode streams by their BOMs. This class
* will recognize the following encodings:
* <ul>
* <li>UTF-8
* <li>UTF-16LE
* <li>UTF-16BE
* <li>UTF-32LE
* <li>UTF-32BE
* <li>UTF-8
* <li>UTF-16LE
* <li>UTF-16BE
* <li>UTF-32LE
* <li>UTF-32BE
* </ul>
* If the stream is not found to be any of the above, then a default encoding
* is used for reading. The user can specify this default encoding, or a system
* default will be used.<p>
* is used for reading. The user can specify this default encoding, or a system
* default will be used.
* <p>
*
* For optimum performance, it is recommended that you wrap all instances of
* <code>UnicodeReader</code> with a <code>java.io.BufferedReader</code>.<p>
* <code>UnicodeReader</code> with a <code>java.io.BufferedReader</code>.
* <p>
*
* This class is mostly ripped off from the workaround in the description of
* Java Bug 4508058.
@@ -43,110 +42,119 @@ import java.io.Reader;
*/
@SuppressWarnings({ "checkstyle:magicnumber" })
public class UnicodeReader extends Reader {
/**
* The input stream from which we're really reading.
*/
private InputStreamReader internalIn = null;
/**
* The encoding being used. We keep our own instead of using the string
* The encoding being used. We keep our own instead of using the string
* returned by <code>java.io.InputStreamReader</code> since that class
* does not return user-friendly names.
*/
private String encoding;
/**
* The size of a BOM.
*/
private static final int BOM_SIZE = 4;
/**
* This utility constructor is here because you will usually use a
* <code>UnicodeReader</code> on files.<p>
* <code>UnicodeReader</code> on files.
* <p>
* Creates a reader using the encoding specified by the BOM in the file;
* if there is no recognized BOM, then a system default encoding is used.
*
* @param file The file from which you want to read.
* @throws IOException If an error occurs when checking for/reading the
* BOM.
* @throws SecurityException If a security manager exists and its
* checkRead method denies read access to the file.
* @param file
* The file from which you want to read.
* @throws IOException
* If an error occurs when checking for/reading the
* BOM.
* @throws SecurityException
* If a security manager exists and its
* checkRead method denies read access to the file.
*/
public UnicodeReader(String file) throws IOException {
this(new File(file));
}
/**
* This utility constructor is here because you will usually use a
* <code>UnicodeReader</code> on files.<p>
* <code>UnicodeReader</code> on files.
* <p>
* Creates a reader using the encoding specified by the BOM in the file;
* if there is no recognized BOM, then a system default encoding is used.
*
* @param file The file from which you want to read.
* @throws IOException If an error occurs when checking for/reading the
* BOM.
* @throws SecurityException If a security manager exists and its
* checkRead method denies read access to the file.
* @param file
* The file from which you want to read.
* @throws IOException
* If an error occurs when checking for/reading the
* BOM.
* @throws SecurityException
* If a security manager exists and its
* checkRead method denies read access to the file.
*/
public UnicodeReader(File file) throws IOException {
this(new FileInputStream(file));
}
/**
* This utility constructor is here because you will usually use a
* <code>UnicodeReader</code> on files.<p>
* <code>UnicodeReader</code> on files.
* <p>
* Creates a reader using the encoding specified by the BOM in the file;
* if there is no recognized BOM, then a specified default encoding is
* used.
*
* @param file The file from which you want to read.
* @param defaultEncoding The encoding to use if no BOM is found. If
* this value is <code>null</code>, a system default is used.
* @throws IOException If an error occurs when checking for/reading the
* BOM.
* @throws SecurityException If a security manager exists and its
* checkRead method denies read access to the file.
* @param file
* The file from which you want to read.
* @param defaultEncoding
* The encoding to use if no BOM is found. If
* this value is <code>null</code>, a system default is used.
* @throws IOException
* If an error occurs when checking for/reading the
* BOM.
* @throws SecurityException
* If a security manager exists and its
* checkRead method denies read access to the file.
*/
public UnicodeReader(File file, String defaultEncoding) throws IOException {
this(new FileInputStream(file), defaultEncoding);
}
/**
* Creates a reader using the encoding specified by the BOM in the file;
* if there is no recognized BOM, then a system default encoding is used.
*
* @param in The input stream from which to read.
* @throws IOException If an error occurs when checking for/reading the
* BOM.
* @param in
* The input stream from which to read.
* @throws IOException
* If an error occurs when checking for/reading the
* BOM.
*/
public UnicodeReader(InputStream in) throws IOException {
this(in, null);
}
/**
* Creates a reader using the encoding specified by the BOM in the file;
* if there is no recognized BOM, then <code>defaultEncoding</code> is
* used.
*
* @param in The input stream from which to read.
* @param defaultEncoding The encoding to use if no recognized BOM is
* found. If this value is <code>null</code>, a system default
* is used.
* @throws IOException If an error occurs when checking for/reading the
* BOM.
* @param in
* The input stream from which to read.
* @param defaultEncoding
* The encoding to use if no recognized BOM is
* found. If this value is <code>null</code>, a system default
* is used.
* @throws IOException
* If an error occurs when checking for/reading the
* BOM.
*/
public UnicodeReader(InputStream in, String defaultEncoding)
throws IOException {
public UnicodeReader(InputStream in, String defaultEncoding) throws IOException {
init(in, defaultEncoding);
}
/**
* Closes this reader.
*/
@@ -154,11 +162,10 @@ public class UnicodeReader extends Reader {
public void close() throws IOException {
internalIn.close();
}
/**
* Returns the encoding being used to read this input stream (i.e., the
* encoding of the file). If a BOM was recognized, then the specific
* encoding of the file). If a BOM was recognized, then the specific
* Unicode type is returned; otherwise, either the default encoding passed
* into the constructor or the system default is returned.
*
@@ -167,88 +174,70 @@ public class UnicodeReader extends Reader {
public String getEncoding() {
return encoding;
}
/**
* Read-ahead four bytes and check for BOM marks. Extra bytes are
* unread back to the stream, only BOM bytes are skipped.
*
* @param defaultEncoding The encoding to use if no BOM was recognized. If
* this value is <code>null</code>, then a system default is used.
* @throws IOException If an error occurs when trying to read a BOM.
* @param defaultEncoding
* The encoding to use if no BOM was recognized. If
* this value is <code>null</code>, then a system default is
* used.
* @throws IOException
* If an error occurs when trying to read a BOM.
*/
protected void init(InputStream in, String defaultEncoding)
throws IOException {
protected void init(InputStream in, String defaultEncoding) throws IOException {
PushbackInputStream tempIn = new PushbackInputStream(in, BOM_SIZE);
byte[] bom = new byte[BOM_SIZE];
int n, unread;
n = tempIn.read(bom, 0, bom.length);
if ((bom[0]==(byte)0x00) && (bom[1]==(byte)0x00) &&
(bom[2]==(byte)0xFE) && (bom[3]==(byte)0xFF)) {
if ((bom[0] == (byte) 0x00) && (bom[1] == (byte) 0x00) && (bom[2] == (byte) 0xFE) && (bom[3] == (byte) 0xFF)) {
encoding = "UTF-32BE";
unread = n - 4;
}
else if (n==BOM_SIZE && // Last 2 bytes are 0; could be an empty UTF-16
(bom[0]==(byte)0xFF) && (bom[1]==(byte)0xFE) &&
(bom[2]==(byte)0x00) && (bom[3]==(byte)0x00)) {
} else if (n == BOM_SIZE && // Last 2 bytes are 0; could be an empty
// UTF-16
(bom[0] == (byte) 0xFF) && (bom[1] == (byte) 0xFE) && (bom[2] == (byte) 0x00) && (bom[3] == (byte) 0x00)) {
encoding = "UTF-32LE";
unread = n - 4;
}
else if ((bom[0]==(byte)0xEF) &&
(bom[1]==(byte)0xBB) &&
(bom[2]==(byte)0xBF)) {
} else if ((bom[0] == (byte) 0xEF) && (bom[1] == (byte) 0xBB) && (bom[2] == (byte) 0xBF)) {
encoding = "UTF-8";
unread = n - 3;
}
else if ((bom[0]==(byte)0xFE) && (bom[1] == (byte)0xFF)) {
} else if ((bom[0] == (byte) 0xFE) && (bom[1] == (byte) 0xFF)) {
encoding = "UTF-16BE";
unread = n - 2;
}
else if ((bom[0]==(byte)0xFF) && (bom[1]== (byte)0xFE)) {
} else if ((bom[0] == (byte) 0xFF) && (bom[1] == (byte) 0xFE)) {
encoding = "UTF-16LE";
unread = n - 2;
}
else {
} else {
// Unicode BOM mark not found, unread all bytes
encoding = defaultEncoding;
unread = n;
}
if (unread > 0) {
tempIn.unread(bom, (n - unread), unread);
}
else if (unread < -1) {
} else if (unread < -1) {
tempIn.unread(bom, 0, 0);
}
// Use given encoding
if (encoding == null) {
internalIn = new InputStreamReader(tempIn);
encoding = internalIn.getEncoding(); // Get the default.
}
else {
} else {
internalIn = new InputStreamReader(tempIn, encoding);
}
}
/**
* Read characters into a portion of an array. This method will block until
* some input is available, an I/O error occurs, or the end of the stream
* is reached.
*
* @param cbuf The buffer into which to read.
* @param off The offset at which to start storing characters.
* @param len The maximum number of characters to read.
* @param cbuf
* The buffer into which to read.
* @param off
* The offset at which to start storing characters.
* @param len
* The maximum number of characters to read.
*
* @return The number of characters read, or <code>-1</code> if the end
* of the stream has been reached.
@@ -257,6 +246,4 @@ public class UnicodeReader extends Reader {
public int read(char[] cbuf, int off, int len) throws IOException {
return internalIn.read(cbuf, off, len);
}
}
}
+79 -109
View File
@@ -1,9 +1,7 @@
/*
* 09/24/2004
*
* UnicodeWriter.java - Writes Unicode output with the proper BOM.
*
* This library is distributed under a modified BSD license. See the included
* This library is distributed under a modified BSD license. See the included
* RSyntaxTextArea.License.txt file for details.
*/
package org.fife.io;
@@ -15,10 +13,9 @@ import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
/**
* Writes Unicode text to an output stream. If the specified encoding is a
* Unicode, then the text is preceded by the proper Unicode BOM. If it is any
* Writes Unicode text to an output stream. If the specified encoding is a
* Unicode, then the text is preceded by the proper Unicode BOM. If it is any
* other encoding, this class behaves just like <code>OutputStreamWriter</code>.
* This class is here because Java's <code>OutputStreamWriter</code> apparently
* doesn't believe in writing BOMs.
@@ -31,115 +28,90 @@ import java.io.Writer;
* @version 0.7
*/
public class UnicodeWriter extends Writer {
/**
* If this system property evaluates to "<code>false</code>", ignoring
* case, files written out as UTF-8 will not have a BOM written for them.
* Otherwise (even if the property is not set), UTF-8 files will have a
* BOM written.
*/
public static final String PROPERTY_WRITE_UTF8_BOM =
"UnicodeWriter.writeUtf8BOM";
public static final String PROPERTY_WRITE_UTF8_BOM = "UnicodeWriter.writeUtf8BOM";
/**
* The writer actually doing the writing.
*/
private OutputStreamWriter internalOut;
private static final byte[] UTF8_BOM = new byte[] {
(byte)0xEF,
(byte)0xBB,
(byte)0xBF
};
private static final byte[] UTF16LE_BOM = new byte[] {
(byte)0xFF,
(byte)0xFE
};
private static final byte[] UTF16BE_BOM = new byte[] {
(byte)0xFE,
(byte)0xFF
};
private static final byte[] UTF32LE_BOM = new byte[] {
(byte)0xFF,
(byte)0xFE,
(byte)0x00,
(byte)0x00
};
private static final byte[] UTF32BE_BOM = new byte[] {
(byte)0x00,
(byte)0x00,
(byte)0xFE,
(byte)0xFF
};
private static final byte[] UTF8_BOM = new byte[] { (byte) 0xEF, (byte) 0xBB, (byte) 0xBF };
private static final byte[] UTF16LE_BOM = new byte[] { (byte) 0xFF, (byte) 0xFE };
private static final byte[] UTF16BE_BOM = new byte[] { (byte) 0xFE, (byte) 0xFF };
private static final byte[] UTF32LE_BOM = new byte[] { (byte) 0xFF, (byte) 0xFE, (byte) 0x00, (byte) 0x00 };
private static final byte[] UTF32BE_BOM = new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0xFE, (byte) 0xFF };
/**
* This is a utility constructor since the vast majority of the time, this
* class will be used to write Unicode files.
*
* @param fileName The file to which to write the Unicode output.
* @param encoding The encoding to use.
* @throws IOException If an IO exception occurs.
* @param fileName
* The file to which to write the Unicode output.
* @param encoding
* The encoding to use.
* @throws IOException
* If an IO exception occurs.
*/
public UnicodeWriter(String fileName, String encoding) throws IOException {
this(new FileOutputStream(fileName), encoding);
}
/**
* This is a utility constructor since the vast majority of the time, this
* class will be used to write Unicode files.
*
* @param file The file to which to write the Unicode output.
* @param encoding The encoding to use.
* @throws IOException If an IO exception occurs.
* @param file
* The file to which to write the Unicode output.
* @param encoding
* The encoding to use.
* @throws IOException
* If an IO exception occurs.
*/
public UnicodeWriter(File file, String encoding) throws IOException {
this(new FileOutputStream(file), encoding);
}
/**
* Creates a new writer.
*
* @param out The output stream to write.
* @param encoding The encoding to use.
* @throws IOException If an IO exception occurs.
* @param out
* The output stream to write.
* @param encoding
* The encoding to use.
* @throws IOException
* If an IO exception occurs.
*/
public UnicodeWriter(OutputStream out, String encoding) throws IOException {
init(out, encoding);
}
/**
* Closes this writer.
*
* @throws IOException If an IO exception occurs.
* @throws IOException
* If an IO exception occurs.
*/
@Override
public void close() throws IOException {
internalOut.close();
}
/**
* Flushes the stream.
*
* @throws IOException If an IO exception occurs.
* @throws IOException
* If an IO exception occurs.
*/
@Override
public void flush() throws IOException {
internalOut.flush();
}
/**
* Returns the encoding being used to write this output stream (i.e., the
* encoding of the file).
@@ -149,8 +121,7 @@ public class UnicodeWriter extends Writer {
public String getEncoding() {
return internalOut.getEncoding();
}
/**
* Returns whether UTF-8 files should have a BOM in them when written.
*
@@ -161,25 +132,25 @@ public class UnicodeWriter extends Writer {
public static boolean getWriteUtf8BOM() {
String prop = System.getProperty(PROPERTY_WRITE_UTF8_BOM);
// We default to writing the BOM, for some reason.
if (prop!=null && Boolean.valueOf(prop).equals(Boolean.FALSE)) {
if (prop != null && Boolean.valueOf(prop).equals(Boolean.FALSE)) {
return false;
}
return true;
}
/**
* Initializes the internal output stream and writes the BOM if the
* specified encoding is a Unicode encoding.
*
* @param out The output stream we are writing.
* @param encoding The encoding in which to write.
* @throws IOException If an I/O error occurs while writing a BOM.
* @param out
* The output stream we are writing.
* @param encoding
* The encoding in which to write.
* @throws IOException
* If an I/O error occurs while writing a BOM.
*/
private void init(OutputStream out, String encoding) throws IOException {
internalOut = new OutputStreamWriter(out, encoding);
// Write the proper BOM if they specified a Unicode encoding.
// NOTE: Creating an OutputStreamWriter with encoding "UTF-16" DOES
// DOES write out the BOM; "UTF-16LE", "UTF-16BE", "UTF-32", "UTF-32LE"
@@ -188,74 +159,73 @@ public class UnicodeWriter extends Writer {
if (getWriteUtf8BOM()) {
out.write(UTF8_BOM, 0, UTF8_BOM.length);
}
}
else if ("UTF-16LE".equals(encoding)) {
} else if ("UTF-16LE".equals(encoding)) {
out.write(UTF16LE_BOM, 0, UTF16LE_BOM.length);
}
else if (/*"UTF-16".equals(encoding) || */"UTF-16BE".equals(encoding)) {
} else if (/* "UTF-16".equals(encoding) || */"UTF-16BE".equals(encoding)) {
out.write(UTF16BE_BOM, 0, UTF16BE_BOM.length);
}
else if ("UTF-32LE".equals(encoding)) {
} else if ("UTF-32LE".equals(encoding)) {
out.write(UTF32LE_BOM, 0, UTF32LE_BOM.length);
}
else if ("UTF-32".equals(encoding) || "UTF-32BE".equals(encoding)) {
} else if ("UTF-32".equals(encoding) || "UTF-32BE".equals(encoding)) {
out.write(UTF32BE_BOM, 0, UTF32BE_BOM.length);
}
}
/**
* Sets whether UTF-8 files should have a BOM written in them.
*
* @param write Whether to write a BOM.
* @param write
* Whether to write a BOM.
* @see #getWriteUtf8BOM()
* @see UnicodeWriter
*/
public static void setWriteUtf8BOM(boolean write) {
System.setProperty(UnicodeWriter.PROPERTY_WRITE_UTF8_BOM,
Boolean.toString(write));
System.setProperty(UnicodeWriter.PROPERTY_WRITE_UTF8_BOM, Boolean.toString(write));
}
/**
* Writes a portion of an array of characters.
*
* @param cbuf The buffer of characters.
* @param off The offset from which to start writing characters.
* @param len The number of characters to write.
* @throws IOException If an I/O error occurs.
* @param cbuf
* The buffer of characters.
* @param off
* The offset from which to start writing characters.
* @param len
* The number of characters to write.
* @throws IOException
* If an I/O error occurs.
*/
@Override
public void write(char[] cbuf, int off, int len) throws IOException {
internalOut.write(cbuf, off, len);
}
/**
* Writes a single character.
*
* @param c An integer specifying the character to write.
* @throws IOException If an IO error occurs.
* @param c
* An integer specifying the character to write.
* @throws IOException
* If an IO error occurs.
*/
@Override
public void write(int c) throws IOException {
internalOut.write(c);
}
/**
* Writes a portion of a string.
*
* @param str The string from which to write.
* @param off The offset from which to start writing characters.
* @param len The number of characters to write.
* @throws IOException If an IO error occurs.
* @param str
* The string from which to write.
* @param off
* The offset from which to start writing characters.
* @param len
* The number of characters to write.
* @throws IOException
* If an IO error occurs.
*/
@Override
public void write(String str, int off, int len) throws IOException {
internalOut.write(str, off, len);
}
}
}