Package com.aoindustries.io.buffer
Class NullBufferWriter
- java.lang.Object
-
- java.io.Writer
-
- com.aoindustries.io.buffer.BufferWriter
-
- com.aoindustries.io.buffer.NullBufferWriter
-
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
public final class NullBufferWriter extends BufferWriter
Discards everything. Not a proper buffer but useful to time the overhead of calling the buffers.- Author:
- AO Industries, Inc.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description NullBufferWriterappend(char c)NullBufferWriterappend(CharSequence csq)NullBufferWriterappend(CharSequence csq, int start, int end)voidclose()voidflush()static NullBufferWritergetInstance()longgetLength()Gets the number of characters in this buffer.EmptyResultgetResult()Gets the result from this buffer.StringtoString()Gets a short message (like type and length).voidwrite(char[] cbuf)voidwrite(char[] cbuf, int off, int len)voidwrite(int c)voidwrite(String str)voidwrite(String str, int off, int len)
-
-
-
Method Detail
-
getInstance
public static NullBufferWriter getInstance()
-
append
public NullBufferWriter append(CharSequence csq)
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter
-
append
public NullBufferWriter append(CharSequence csq, int start, int end)
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter
-
append
public NullBufferWriter append(char c)
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter
-
flush
public void flush()
-
close
public void close()
-
getLength
public long getLength()
Description copied from class:BufferWriterGets the number of characters in this buffer. Once closed, this length will not be modified.- Specified by:
getLengthin classBufferWriter
-
toString
public String toString()
Description copied from class:BufferWriterGets a short message (like type and length).- Specified by:
toStringin classBufferWriter- See Also:
To get access to the buffered content.
-
getResult
public EmptyResult getResult()
Description copied from class:BufferWriterGets the result from this buffer. The buffer must be closed.- Specified by:
getResultin classBufferWriter
-
-