java.lang.Object
java.io.Writer
com.aoapps.io.buffer.BufferWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
- Direct Known Subclasses:
AutoTempFileWriter,CharArrayBufferWriter,LoggingWriter,NullBufferWriter,SegmentedWriter,TempFileWriter
A buffered writer with results that may be trimmed, converted to String, and written to another
writer.
- Author:
- AO Industries, Inc.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract longGets the number of characters in this buffer.abstract BufferResultGets the result from this buffer.abstract StringtoString()Gets a short message (like type and length).
-
Constructor Details
-
BufferWriter
protected BufferWriter()
-
-
Method Details
-
getLength
Gets the number of characters in this buffer. Once closed, this length will not be modified.- Throws:
IOException
-
toString
Gets a short message (like type and length). -
getResult
Gets the result from this buffer. The buffer must be closed.Note: Although the
BufferWriterare generally not thread-safe, theBufferResultis 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.- Throws:
IllegalStateException- if not closedIOException
-
