public class LineCountingFilterWriter
extends java.io.FilterWriter
LineCountingFilterWriter
keeps track of the current line going through the character
stream. If the write throws an exception, the line count
remains unchanged.| Modifier and Type | Field and Description |
|---|---|
protected int |
d_line_count |
| Constructor and Description |
|---|
LineCountingFilterWriter(java.io.Writer out) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
countLines(char[] x,
int off,
int len) |
int |
getLineCount() |
void |
setLineCount(int i) |
void |
write(char[] cbuf,
int off,
int len) |
void |
write(int c) |
void |
write(java.lang.String str,
int off,
int len) |
public int getLineCount()
public void setLineCount(int i)
public void write(int c)
throws java.io.IOException
write in class java.io.FilterWriterjava.io.IOExceptionpublic void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
write in class java.io.FilterWriterjava.io.IOExceptionpublic void write(java.lang.String str,
int off,
int len)
throws java.io.IOException
write in class java.io.FilterWriterjava.io.IOExceptionprotected int countLines(char[] x,
int off,
int len)