Class UTF8Writer
java.lang.Object
java.io.Writer
com.fasterxml.jackson.dataformat.csv.impl.UTF8Writer
- All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable
Efficient UTF-8 backed writer.
Note: original implementation based on writer from Jackson core package; modified slightly, copied to reduce dependency to impl details.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.fasterxml.jackson.core.io.IOContextprivate OutputStreamprivate byte[]private final intprivate intprivate intWhen outputting chars from BMP, surrogate pairs need to be coalesced.private static final intprivate static final intprivate static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend(char c) voidclose()private intconvertSurrogate(int secondPart) Method called to calculate UTF code point, from a surrogate pair.voidflush()private voidthrowIllegal(int code) voidwrite(char[] cbuf) voidwrite(char[] cbuf, int off, int len) voidwrite(int c) voidvoidMethods inherited from class Writer
append, append, nullWriter
-
Field Details
-
SURR1_FIRST
private static final int SURR1_FIRST- See Also:
-
SURR1_LAST
private static final int SURR1_LAST- See Also:
-
SURR2_FIRST
private static final int SURR2_FIRST- See Also:
-
SURR2_LAST
private static final int SURR2_LAST- See Also:
-
_context
private final com.fasterxml.jackson.core.io.IOContext _context -
_out
-
_outBuffer
private byte[] _outBuffer -
_outBufferEnd
private final int _outBufferEnd -
_outPtr
private int _outPtr -
_surrogate
private int _surrogateWhen outputting chars from BMP, surrogate pairs need to be coalesced. To do this, both pairs must be known first; and since it is possible pairs may be split, we need temporary storage for the first half
-
-
Constructor Details
-
UTF8Writer
-
-
Method Details
-
append
- Specified by:
appendin interfaceAppendable- Overrides:
appendin classWriter- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-
flush
- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Specified by:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
convertSurrogate
Method called to calculate UTF code point, from a surrogate pair.- Throws:
IOException
-
throwIllegal
- Throws:
IOException
-