- java.lang.Object
-
- com.github.akurilov.commons.io.TextStreamOutput
-
- All Implemented Interfaces:
Output<java.lang.String>,java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
TextFileOutput
public abstract class TextStreamOutput extends java.lang.Object implements Output<java.lang.String>
The input implementation designed to write the text lines usingBufferedWriter
-
-
Field Summary
Fields Modifier and Type Field Description protected java.io.BufferedWriterwriter
-
Constructor Summary
Constructors Constructor Description TextStreamOutput(java.io.OutputStream out)TextStreamOutput(java.io.OutputStream out, int buffSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanput(java.lang.String line)Write the data itemintput(java.util.List<java.lang.String> lines)Uses the thread local string builder to concatenate the lines into the single text block for better performanceintput(java.util.List<java.lang.String> lines, int from, int to)Uses the thread local string builder to concatenate the lines into the single text block for better performance
-
-
-
Method Detail
-
put
public boolean put(java.lang.String line) throws java.io.IOExceptionDescription copied from interface:OutputWrite the data item
-
put
public int put(java.util.List<java.lang.String> lines, int from, int to) throws java.io.IOExceptionUses the thread local string builder to concatenate the lines into the single text block for better performance
-
put
public int put(java.util.List<java.lang.String> lines) throws java.io.IOExceptionUses the thread local string builder to concatenate the lines into the single text block for better performance
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-