Package com.atlassian.confluence.util.io
Class CharacterCountingWriter
java.lang.Object
java.io.Writer
com.atlassian.confluence.util.io.CharacterCountingWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
A
Writer which delegates to another Writer, and counts the number of characters that
gets written to the delegate.
The resulting count is only reliable if no exceptions get thrown by any of the methods.
- Since:
- 5.8
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend(char c) append(CharSequence csq) append(CharSequence csq, int start, int end) voidclose()voidflush()longvoidwrite(@org.checkerframework.checker.nullness.qual.NonNull char[] cbuf) voidwrite(@org.checkerframework.checker.nullness.qual.NonNull char[] cbuf, int off, int len) voidwrite(int c) voidvoidMethods inherited from class java.io.Writer
nullWriter
-
Constructor Details
-
CharacterCountingWriter
-
-
Method Details
-
getCharacterCount
public long getCharacterCount() -
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
public void write(@org.checkerframework.checker.nullness.qual.NonNull char[] cbuf) throws IOException - Overrides:
writein classWriter- Throws:
IOException
-
write
public void write(@org.checkerframework.checker.nullness.qual.NonNull char[] cbuf, int off, int len) throws IOException - Specified by:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-