| java.lang.Object java.io.Writer java.io.FilterWriter org.geotools.io.LineWriter
LineWriter | public class LineWriter extends FilterWriter (Code) | | Write characters to a stream while replacing various EOL by a unique string.
This class catch all occurrences of "\r" , "\n" and
"\r\n" , and replace them by the platform depend EOL string
("\r\n" on Windows, "\n" on Unix), or any other EOL
explicitly set at construction time. This writer also remove trailing blanks
before end of lines.
version: $Id: LineWriter.java 22482 2006-10-31 02:58:00Z desruisseaux $ author: Martin Desruisseaux since: 2.0 |
Constructor Summary | |
public | LineWriter(Writer out) Construct a
LineWriter object that
will use the platform dependent line separator. | public | LineWriter(Writer out, String lineSeparator) Construct a
LineWriter object
that will use the specified line separator. |
Method Summary | |
public void | flush() Flush the stream's content to the underlying stream. | public String | getLineSeparator() Returns the current line separator. | public void | setLineSeparator(String lineSeparator) Change the line separator. | public void | write(int c) Write a single character. | public void | write(char cbuf, int offset, int length) Write a portion of an array of characters. | public void | write(String string, int offset, int length) Write a portion of an array of a string. |
LineWriter | public LineWriter(Writer out)(Code) | | Construct a
LineWriter object that
will use the platform dependent line separator.
Parameters: out - a Writer object to provide the underlying stream. throws: IllegalArgumentException - if out is null . |
LineWriter | public LineWriter(Writer out, String lineSeparator)(Code) | | Construct a
LineWriter object
that will use the specified line separator.
Parameters: out - a Writer object to provide the underlying stream. Parameters: lineSeparator - String to use as line separator. throws: IllegalArgumentException - if out or lineSeparator is null . |
flush | public void flush() throws IOException(Code) | | Flush the stream's content to the underlying stream. This method flush completly
all internal buffers, including any whitespace characters that should have been
skipped if the next non-blank character is a line separator.
throws: IOException - If an I/O error occurs |
getLineSeparator | public String getLineSeparator()(Code) | | Returns the current line separator.
The current line separator. |
setLineSeparator | public void setLineSeparator(String lineSeparator)(Code) | | Change the line separator. This is the string to insert in place of
every occurences of "\r", "\n" or "\r\n".
Parameters: lineSeparator - The new line separator. throws: IllegalArgumentException - if lineSeparator is null . |
write | public void write(char cbuf, int offset, int length) throws IOException(Code) | | Write a portion of an array of characters.
Parameters: cbuf - Buffer of characters to be written Parameters: offset - Offset from which to start reading characters Parameters: length - Number of characters to be written throws: IOException - If an I/O error occurs |
write | public void write(String string, int offset, int length) throws IOException(Code) | | Write a portion of an array of a string.
Parameters: string - String to be written Parameters: offset - Offset from which to start reading characters Parameters: length - Number of characters to be written throws: IOException - If an I/O error occurs |
|
|