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) void
close()
void
flush()
long
void
write
(@org.checkerframework.checker.nullness.qual.NonNull char[] cbuf) void
write
(@org.checkerframework.checker.nullness.qual.NonNull char[] cbuf, int off, int len) void
write
(int c) void
void
Methods inherited from class java.io.Writer
nullWriter
-
Constructor Details
-
CharacterCountingWriter
-
-
Method Details
-
getCharacterCount
public long getCharacterCount() -
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
public void write(@org.checkerframework.checker.nullness.qual.NonNull char[] cbuf) throws IOException - Overrides:
write
in classWriter
- Throws:
IOException
-
write
public void write(@org.checkerframework.checker.nullness.qual.NonNull char[] cbuf, int off, int len) throws IOException - Specified by:
write
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in classWriter
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classWriter
- Throws:
IOException
-