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
-
Method Summary
Modifier and TypeMethodDescriptionabstract long
Gets the number of characters in this buffer.abstract BufferResult
Gets the result from this buffer.abstract String
toString()
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
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.- Throws:
IllegalStateException
- if not closedIOException
-