java.lang.Object
java.io.Writer
java.io.FilterWriter
de.siegmar.fastcsv.writer.FastBufferedWriter
- All Implemented Interfaces:
Writable
,Closeable
,Flushable
,Appendable
,AutoCloseable
High-performance buffered writer (without synchronization).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
private final boolean
private final char[]
private int
Fields inherited from class java.io.FilterWriter
out
-
Constructor Summary
ConstructorsConstructorDescriptionFastBufferedWriter
(Writer writer, int bufferSize, boolean autoFlushBuffer, boolean autoFlushWriter) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
Called to indicate that the current record is complete.void
flush()
private void
void
write
(char[] cbuf, int off, int len) Writes a portion of an array of characters.void
write
(int c) Writes a single character.void
Writes a portion of a string.
-
Field Details
-
buf
private final char[] buf -
autoFlushBuffer
private final boolean autoFlushBuffer -
autoFlushWriter
private final boolean autoFlushWriter -
pos
private int pos
-
-
Constructor Details
-
FastBufferedWriter
FastBufferedWriter(Writer writer, int bufferSize, boolean autoFlushBuffer, boolean autoFlushWriter)
-
-
Method Details
-
write
Description copied from interface:Writable
Writes a single character.- Specified by:
write
in interfaceWritable
- Overrides:
write
in classFilterWriter
- Parameters:
c
- the character to write- Throws:
IOException
- See Also:
-
write
Description copied from interface:Writable
Writes a portion of an array of characters.- Specified by:
write
in interfaceWritable
- Overrides:
write
in classFilterWriter
- Parameters:
cbuf
- the array of characters to writeoff
- the offset from which to start writing characterslen
- the number of characters to write- Throws:
IOException
- See Also:
-
write
Description copied from interface:Writable
Writes a portion of a string.- Specified by:
write
in interfaceWritable
- Overrides:
write
in classFilterWriter
- Parameters:
str
- the string to writeoff
- the offset from which to start writing characterslen
- the number of characters to write- Throws:
IOException
- See Also:
-
endRecord
Description copied from interface:Writable
Called to indicate that the current record is complete.- Specified by:
endRecord
in interfaceWritable
- Throws:
IOException
- if an I/O error occurs
-
flushBuffer
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Overrides:
flush
in classFilterWriter
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterWriter
- Throws:
IOException
-