java.lang.Object
java.io.Writer
com.aoapps.io.buffer.BufferWriter
com.aoapps.io.buffer.NullBufferWriter
- All Implemented Interfaces:
NoClose
,Closeable
,Flushable
,Appendable
,AutoCloseable
Discards everything. Not a proper buffer but useful to time the overhead of calling the buffers.
- Author:
- AO Industries, Inc.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionappend
(char c) append
(CharSequence csq) append
(CharSequence csq, int start, int end) void
close()
void
flush()
static NullBufferWriter
long
Gets the number of characters in this buffer.Gets the result from this buffer.toString()
Gets a short message (like type and length).void
write
(char[] cbuf) void
write
(char[] cbuf, int off, int len) void
write
(int c) void
void
Methods inherited from class java.io.Writer
nullWriter
-
Method Details
-
getInstance
-
write
public void write(int c) -
write
public void write(char[] cbuf) -
write
public void write(char[] cbuf, int off, int len) -
write
-
write
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
-
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
-
flush
public void flush() -
close
public void close() -
getLength
public long getLength()Description copied from class:BufferWriter
Gets the number of characters in this buffer. Once closed, this length will not be modified.- Specified by:
getLength
in classBufferWriter
-
toString
Description copied from class:BufferWriter
Gets a short message (like type and length).- Specified by:
toString
in classBufferWriter
- See Also:
-
getResult
Description copied from class:BufferWriter
Gets the result from this buffer. The buffer must be closed.Note: Although the
BufferWriter
are generally not thread-safe, theBufferResult
is thread-safe. It is expected to commonly create a buffer on one thread, but the be able to safely share the result among many threads.- Specified by:
getResult
in classBufferWriter
-