| Modifier and Type | Field and Description |
|---|---|
| protected BufferedValue[] | _buffered
And if output comes in shuffled order we will need to do bit of ordering. |
| protected boolean | _bufferRecyclable
Flag that indicates whether the |
| protected final boolean | |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| protected final char | |
| protected final char | |
| protected final int | |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| protected final char[] | |
| protected final int | |
| protected final int | |
| protected final int | _cfgMinSafeChar
Lowest-valued character that is safe to output without using quotes around value, NOT including possible escape character. |
| protected final char[] | |
| protected boolean | _cfgOptimalQuoting
Marker flag used to determine if to do optimal (aka "strict") quoting checks or not (looser conservative check) |
| protected final int | |
| protected final char | |
| protected boolean | |
| protected int | _charsWritten
Let's keep track of how many bytes have been output, may prove useful when debugging. |
| protected int | |
| protected int | |
| protected final IOContext | |
| protected int | _lastBuffered
Index of the last buffered value |
| protected int | _nextColumnToWrite
Index of column we expect to write next |
| protected final Writer | |
| protected char[] | _outputBuffer
Intermediate buffer in which contents are buffered before
being written using |
| protected final int | _outputEnd
Offset to index after the last valid index in |
| protected int[] | _outputEscapes
Currently active set of output escape code definitions (whether and how to escape or not). |
| protected int | _outputTail
Pointer to the next available char position in |
| protected boolean | |
| private static final char[] | |
| protected static final char[] | |
| protected static final int | MAX_QUOTE_CHECK
Also: only do check for optional quotes for short values; longer ones will always be quoted. |
| protected final BufferedValue[] | |
| protected static final int | SHORT_WRITE
As an optimization we try coalescing short writes into buffer; but pass longer directly. |
| private static final int[] | |
| private static final char[] |
| Access | Constructor and Description |
|---|---|
| public | |
| public | CsvEncoder(IOContext ctxt, int csvFeatures, Writer out, CsvSchema schema, boolean useFastDoubleWriter)
|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| private void | _appendCharacterEscape(char ch, int escCode)
Method called to append escape sequence for given character, at the end of standard output buffer; or if not possible, write out directly. |
| protected void | |
| private final int | |
| protected void | |
| private final char | _getQuoteCharEscapeChar(final boolean escapeQuoteCharWithEscapeChar, final int quoteCharacter, final int escapeCharacter)
|
| protected boolean | _mayNeedQuotes(String value, int length, int columnIndex)
Helper method that determines whether given String is likely to require quoting; check tries to optimize for speed. |
| protected final boolean | |
| protected final boolean | |
| protected boolean | |
| protected boolean | |
| public void | |
| private void | |
| private final void | |
| private final void | |
| public void | |
| protected void | |
| public void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| protected void | |
| public void | |
| public void | |
| public void | |
| public int | getOutputBuffered()
Note while value does indeed indicate amount that has been written in the buffer, there may be more intermediate data that is buffered as values but not yet in buffer. |
| public Object | |
| public int | |
| public CsvEncoder | |
| public CsvEncoder | |
| public CsvEncoder | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| private void | |
| public void | |
| public void | |
| public void | |
| public void | |
| private void |
| _buffered | back to summary |
|---|---|
| protected BufferedValue[] _buffered And if output comes in shuffled order we will need to do bit of ordering. | |
| _bufferRecyclable | back to summary |
|---|---|
| protected boolean _bufferRecyclable Flag that indicates whether the | |
| _cfgAllowsComments | back to summary |
|---|---|
| protected final boolean _cfgAllowsComments | |
| _cfgAlwaysQuoteEmptyStrings | back to summary |
|---|---|
| protected boolean _cfgAlwaysQuoteEmptyStrings | |
| _cfgAlwaysQuoteNumbers | back to summary |
|---|---|
| protected boolean _cfgAlwaysQuoteNumbers | |
| _cfgAlwaysQuoteStrings | back to summary |
|---|---|
protected boolean _cfgAlwaysQuoteStrings
| |
| _cfgColumnSeparator | back to summary |
|---|---|
| protected final char _cfgColumnSeparator | |
| _cfgControlCharEscapeChar | back to summary |
|---|---|
protected final char _cfgControlCharEscapeChar
| |
| _cfgEscapeCharacter | back to summary |
|---|---|
protected final int _cfgEscapeCharacter
| |
| _cfgEscapeControlCharWithEscapeChar | back to summary |
|---|---|
protected boolean _cfgEscapeControlCharWithEscapeChar
| |
| _cfgEscapeQuoteCharWithEscapeChar | back to summary |
|---|---|
| protected boolean _cfgEscapeQuoteCharWithEscapeChar | |
| _cfgIncludeMissingTail | back to summary |
|---|---|
protected boolean _cfgIncludeMissingTail
| |
| _cfgLineSeparator | back to summary |
|---|---|
| protected final char[] _cfgLineSeparator | |
| _cfgLineSeparatorLength | back to summary |
|---|---|
| protected final int _cfgLineSeparatorLength | |
| _cfgMaxQuoteCheckChars | back to summary |
|---|---|
| protected final int _cfgMaxQuoteCheckChars | |
| _cfgMinSafeChar | back to summary |
|---|---|
| protected final int _cfgMinSafeChar Lowest-valued character that is safe to output without using quotes around value, NOT including possible escape character. | |
| _cfgNullValue | back to summary |
|---|---|
protected final char[] _cfgNullValue
| |
| _cfgOptimalQuoting | back to summary |
|---|---|
| protected boolean _cfgOptimalQuoting Marker flag used to determine if to do optimal (aka "strict") quoting checks or not (looser conservative check)
| |
| _cfgQuoteCharacter | back to summary |
|---|---|
| protected final int _cfgQuoteCharacter | |
| _cfgQuoteCharEscapeChar | back to summary |
|---|---|
| protected final char _cfgQuoteCharEscapeChar | |
| _cfgUseFastDoubleWriter | back to summary |
|---|---|
protected boolean _cfgUseFastDoubleWriter
| |
| _charsWritten | back to summary |
|---|---|
| protected int _charsWritten Let's keep track of how many bytes have been output, may prove useful when debugging. This does not include bytes buffered in the output buffer, just bytes that have been written using underlying stream writer. | |
| _columnCount | back to summary |
|---|---|
protected int _columnCount
| |
| _csvFeatures | back to summary |
|---|---|
| protected int _csvFeatures | |
| _ioContext | back to summary |
|---|---|
| protected final IOContext _ioContext | |
| _lastBuffered | back to summary |
|---|---|
| protected int _lastBuffered Index of the last buffered value | |
| _nextColumnToWrite | back to summary |
|---|---|
| protected int _nextColumnToWrite Index of column we expect to write next | |
| _out | back to summary |
|---|---|
| protected final Writer _out Underlying | |
| _outputBuffer | back to summary |
|---|---|
| protected char[] _outputBuffer Intermediate buffer in which contents are buffered before
being written using | |
| _outputEnd | back to summary |
|---|---|
| protected final int _outputEnd Offset to index after the last valid index in | |
| _outputEscapes | back to summary |
|---|---|
| protected int[] _outputEscapes Currently active set of output escape code definitions (whether and how to escape or not). | |
| _outputTail | back to summary |
|---|---|
| protected int _outputTail Pointer to the next available char position in | |
| _trailingLFRemoved | back to summary |
|---|---|
| protected boolean _trailingLFRemoved | |
| FALSE_CHARS | back to summary |
|---|---|
| private static final char[] FALSE_CHARS | |
| HEX_CHARS | back to summary |
|---|---|
| protected static final char[] HEX_CHARS | |
| MAX_QUOTE_CHECK | back to summary |
|---|---|
| protected static final int MAX_QUOTE_CHECK Also: only do check for optional quotes for short values; longer ones will always be quoted. | |
| NO_BUFFERED | back to summary |
|---|---|
| protected final BufferedValue[] NO_BUFFERED | |
| SHORT_WRITE | back to summary |
|---|---|
| protected static final int SHORT_WRITE As an optimization we try coalescing short writes into buffer; but pass longer directly. | |
| sOutputEscapes | back to summary |
|---|---|
| private static final int[] sOutputEscapes | |
| TRUE_CHARS | back to summary |
|---|---|
| private static final char[] TRUE_CHARS | |
| CsvEncoder | back to summary |
|---|---|
| public CsvEncoder(IOContext ctxt, int csvFeatures, Writer out, CsvSchema schema)
Deprecated
| |
| CsvEncoder | back to summary |
|---|---|
| public CsvEncoder(IOContext ctxt, int csvFeatures, Writer out, CsvSchema schema, boolean useFastDoubleWriter) | |
| CsvEncoder | back to summary |
|---|---|
| public CsvEncoder(CsvEncoder base, CsvSchema newSchema) | |
| _append | back to summary |
|---|---|
| protected void _append(char[] ch) throws IOException | |
| _appendCharacterEscape | back to summary |
|---|---|
| private void _appendCharacterEscape(char ch, int escCode) throws IOException Method called to append escape sequence for given character, at the end of standard output buffer; or if not possible, write out directly. | |
| _buffer | back to summary |
|---|---|
| protected void _buffer(int index, BufferedValue v) | |
| _calcSafeChar | back to summary |
|---|---|
| private final int _calcSafeChar() | |
| _flushBuffer | back to summary |
|---|---|
| protected void _flushBuffer() throws IOException | |
| _getQuoteCharEscapeChar | back to summary |
|---|---|
| private final char _getQuoteCharEscapeChar(final boolean escapeQuoteCharWithEscapeChar, final int quoteCharacter, final int escapeCharacter) | |
| _mayNeedQuotes | back to summary |
|---|---|
| protected boolean _mayNeedQuotes(String value, int length, int columnIndex) Helper method that determines whether given String is likely to require quoting; check tries to optimize for speed. | |
| _needsQuotingLoose | back to summary |
|---|---|
protected final boolean _needsQuotingLoose(String value)
| |
| _needsQuotingLoose | back to summary |
|---|---|
| protected final boolean _needsQuotingLoose(String value, int esc) | |
| _needsQuotingStrict | back to summary |
|---|---|
protected boolean _needsQuotingStrict(String value)
| |
| _needsQuotingStrict | back to summary |
|---|---|
protected boolean _needsQuotingStrict(String value, int esc)
| |
| _releaseBuffers | back to summary |
|---|---|
| public void _releaseBuffers() | |
| _removeTrailingLF | back to summary |
|---|---|
| private void _removeTrailingLF() throws IOException | |
| _writeLongQuoted | back to summary |
|---|---|
| private final void _writeLongQuoted(String text, char q) throws IOException | |
| _writeLongQuotedAndEscaped | back to summary |
|---|---|
| private final void _writeLongQuotedAndEscaped(String text, char esc) throws IOException | |
| _writeQuoted | back to summary |
|---|---|
| public void _writeQuoted(String text) throws IOException | |
| _writeQuoted | back to summary |
|---|---|
| protected void _writeQuoted(String text, char q, int i) throws IOException | |
| _writeQuotedAndEscaped | back to summary |
|---|---|
| public void _writeQuotedAndEscaped(String text, char esc) throws IOException | |
| _writeQuotedAndEscaped | back to summary |
|---|---|
| protected void _writeQuotedAndEscaped(String text, char q, char esc, int i) throws IOException | |
| appendColumnSeparator | back to summary |
|---|---|
| protected void appendColumnSeparator() throws IOException | |
| appendNull | back to summary |
|---|---|
| protected void appendNull() throws IOException | |
| appendNumberValue | back to summary |
|---|---|
| protected void appendNumberValue(String numStr) throws IOException | |
| appendRawValue | back to summary |
|---|---|
| protected void appendRawValue(String value) throws IOException | |
| appendValue | back to summary |
|---|---|
| protected void appendValue(String value) throws IOException | |
| appendValue | back to summary |
|---|---|
| protected void appendValue(int value) throws IOException | |
| appendValue | back to summary |
|---|---|
| protected void appendValue(long value) throws IOException | |
| appendValue | back to summary |
|---|---|
| protected void appendValue(float value) throws IOException | |
| appendValue | back to summary |
|---|---|
| protected void appendValue(double value) throws IOException | |
| appendValue | back to summary |
|---|---|
| protected void appendValue(boolean value) throws IOException | |
| close | back to summary |
|---|---|
| public void close(boolean autoClose, boolean flushStream) throws IOException | |
| endRow | back to summary |
|---|---|
| public void endRow() throws IOException | |
| flush | back to summary |
|---|---|
| public void flush(boolean flushStream) throws IOException | |
| getOutputBuffered | back to summary |
|---|---|
| public int getOutputBuffered() Note while value does indeed indicate amount that has been written in the buffer, there may be more intermediate data that is buffered as values but not yet in buffer. | |
| getOutputTarget | back to summary |
|---|---|
| public Object getOutputTarget() | |
| nextColumnIndex | back to summary |
|---|---|
| public int nextColumnIndex() | |
| overrideFormatFeatures | back to summary |
|---|---|
| public CsvEncoder overrideFormatFeatures(int feat) | |
| setOutputEscapes | back to summary |
|---|---|
| public CsvEncoder setOutputEscapes(int[] esc) | |
| withSchema | back to summary |
|---|---|
| public CsvEncoder withSchema(CsvSchema schema) | |
| write | back to summary |
|---|---|
| public final void write(int columnIndex, String value) throws IOException | |
| write | back to summary |
|---|---|
| public final void write(int columnIndex, char[] ch, int offset, int len) throws IOException | |
| write | back to summary |
|---|---|
| public final void write(int columnIndex, int value) throws IOException | |
| write | back to summary |
|---|---|
| public final void write(int columnIndex, long value) throws IOException | |
| write | back to summary |
|---|---|
| public final void write(int columnIndex, BigInteger value) throws IOException | |
| write | back to summary |
|---|---|
| public final void write(int columnIndex, float value) throws IOException | |
| write | back to summary |
|---|---|
| public final void write(int columnIndex, double value) throws IOException | |
| write | back to summary |
|---|---|
| public final void write(int columnIndex, BigDecimal value, boolean plain) throws IOException | |
| write | back to summary |
|---|---|
| public final void write(int columnIndex, boolean value) throws IOException | |
| writeColumnName | back to summary |
|---|---|
| public final void writeColumnName(String name) throws IOException | |
| writeNonEscaped | back to summary |
|---|---|
public final void writeNonEscaped(int columnIndex, String rawValue) throws IOException
| |
| writeNull | back to summary |
|---|---|
| public final void writeNull(int columnIndex) throws IOException | |
| writeNumber | back to summary |
|---|---|
| private void writeNumber(String text) throws IOException | |
| writeRaw | back to summary |
|---|---|
| public void writeRaw(String text) throws IOException | |
| writeRaw | back to summary |
|---|---|
| public void writeRaw(String text, int start, int len) throws IOException | |
| writeRaw | back to summary |
|---|---|
| public void writeRaw(char[] text, int offset, int len) throws IOException | |
| writeRaw | back to summary |
|---|---|
| public void writeRaw(char c) throws IOException | |
| writeRawLong | back to summary |
|---|---|
| private void writeRawLong(String text) throws IOException | |