|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.Writer java.io.FilterWriter org.geotools.io.LineWriter
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.
Field Summary |
Fields inherited from class java.io.FilterWriter |
out |
Fields inherited from class java.io.Writer |
lock |
Constructor Summary | |
LineWriter(java.io.Writer out)
Construct a object that will use the platform dependent line separator. |
|
LineWriter(java.io.Writer out,
java.lang.String lineSeparator)
Construct a object that will use the specified line separator. |
Method Summary | |
void |
flush()
Flush the stream's content to the underlying stream. |
java.lang.String |
getLineSeparator()
Returns the current line separator. |
void |
setLineSeparator(java.lang.String lineSeparator)
Change the line separator. |
void |
write(char[] cbuf,
int offset,
int length)
Write a portion of an array of characters. |
void |
write(int c)
Write a single character. |
void |
write(java.lang.String string,
int offset,
int length)
Write a portion of an array of a string. |
Methods inherited from class java.io.FilterWriter |
close |
Methods inherited from class java.io.Writer |
write, write |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LineWriter(java.io.Writer out)
out
- a Writer object to provide the underlying stream.
java.lang.IllegalArgumentException
- if is .public LineWriter(java.io.Writer out, java.lang.String lineSeparator)
out
- a Writer object to provide the underlying stream.lineSeparator
- String to use as line separator.
java.lang.IllegalArgumentException
- if or
is .Method Detail |
public java.lang.String getLineSeparator()
public void setLineSeparator(java.lang.String lineSeparator)
lineSeparator
- The new line separator.
java.lang.IllegalArgumentException
- if is .public void write(int c) throws java.io.IOException
java.io.IOException
- If an I/O error occurspublic void write(char[] cbuf, int offset, int length) throws java.io.IOException
cbuf
- Buffer of characters to be writtenoffset
- Offset from which to start reading characterslength
- Number of characters to be written
java.io.IOException
- If an I/O error occurspublic void write(java.lang.String string, int offset, int length) throws java.io.IOException
string
- String to be writtenoffset
- Offset from which to start reading characterslength
- Number of characters to be written
java.io.IOException
- If an I/O error occurspublic void flush() throws java.io.IOException
java.io.IOException
- If an I/O error occurs
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |