public class CountingOutputWriter
extends java.io.FilterWriter
Constructor and Description |
---|
CountingOutputWriter(java.io.Writer writer)
Create the CountingOutputWriter for the specified writer
|
Modifier and Type | Method and Description |
---|---|
long |
getCount()
Return the number of characters written
|
void |
write(char[] cbuf)
Write an array of characters
|
void |
write(char[] cbuf,
int off,
int len)
Write an array of characters starting at the specified offset
|
void |
write(int c)
Write a single character
|
void |
write(java.lang.String s)
Write a string
|
void |
write(java.lang.String s,
int off,
int len)
Write a substring
|
public CountingOutputWriter(java.io.Writer writer)
writer
- Output writerpublic void write(int c) throws java.io.IOException
write
in class java.io.FilterWriter
c
- Character to be writtenjava.io.IOException
- I/O error occurredpublic void write(char[] cbuf) throws java.io.IOException
write
in class java.io.Writer
cbuf
- Characters to be writtenjava.io.IOException
- I/O error occurredpublic void write(char[] cbuf, int off, int len) throws java.io.IOException
write
in class java.io.FilterWriter
cbuf
- Characters to be writtenoff
- Starting offsetlen
- Number of characters to writejava.io.IOException
- I/O error occurredpublic void write(java.lang.String s) throws java.io.IOException
write
in class java.io.Writer
s
- String to be writtenjava.io.IOException
- I/O error occurredpublic void write(java.lang.String s, int off, int len) throws java.io.IOException
write
in class java.io.FilterWriter
s
- String to be writtenoff
- Starting offsetlen
- Number of characters to writejava.io.IOException
- I/O error occurredpublic long getCount()