Package nxt.util
Class CountingOutputWriter
java.lang.Object
java.io.Writer
java.io.FilterWriter
nxt.util.CountingOutputWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
CountingOutputWriter extends Writer to count the number of characters written
-
Field Summary
Fields inherited from class java.io.FilterWriter
out -
Constructor Summary
ConstructorsConstructorDescriptionCountingOutputWriter(Writer writer) Create the CountingOutputWriter for the specified writer -
Method Summary
Methods inherited from class java.io.FilterWriter
close, flush
-
Constructor Details
-
CountingOutputWriter
Create the CountingOutputWriter for the specified writer- Parameters:
writer- Output writer
-
-
Method Details
-
write
Write a single character- Overrides:
writein classFilterWriter- Parameters:
c- Character to be written- Throws:
IOException- I/O error occurred
-
write
Write an array of characters starting at the specified offset- Overrides:
writein classFilterWriter- Parameters:
cbuf- Characters to be writtenoff- Starting offsetlen- Number of characters to write- Throws:
IOException- I/O error occurred
-
write
Write a substring- Overrides:
writein classFilterWriter- Parameters:
s- String to be writtenoff- Starting offsetlen- Number of characters to write- Throws:
IOException- I/O error occurred
-
getCount
public long getCount()Return the number of characters written- Returns:
- Character count
-