public class IndentedLineWriter extends FilterWriter
setIndentation(int) in order to set a different value.out| Constructor and Description |
|---|
IndentedLineWriter(Writer out)
Constructs a stream which will add spaces in front of each line.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
beginNewLine()
Invoked when a new line is begining.
|
int |
getIdentation()
Returns the current indentation.
|
void |
setIndentation(int width)
Sets the indentation to the specified value.
|
void |
write(char[] buffer,
int offset,
int length)
Writes a portion of an array of characters.
|
void |
write(int c)
Writes a single character.
|
void |
write(String string,
int offset,
int length)
Writes a portion of a string.
|
close, flushpublic IndentedLineWriter(Writer out)
out - The underlying stream to write to.public int getIdentation()
public void setIndentation(int width)
width - The new indentation.protected void beginNewLine()
throws IOException
setIndentation(int).IOException - If an I/O error occurspublic void write(int c)
throws IOException
write in class FilterWriterIOException - If an I/O error occurs.public void write(char[] buffer,
int offset,
int length)
throws IOException
write in class FilterWriterbuffer - Buffer of characters to be written.offset - Offset from which to start reading characters.length - Number of characters to be written.IOException - If an I/O error occurs.public void write(String string, int offset, int length) throws IOException
write in class FilterWriterstring - String to be written.offset - Offset from which to start reading characters.length - Number of characters to be written.IOException - If an I/O error occurs.Copyright © 1996–2019 Geotools. All rights reserved.