Class UTF8Writer
java.lang.Object
java.io.Writer
com.fasterxml.jackson.dataformat.yaml.UTF8Writer
- All Implemented Interfaces:
Closeable
,Flushable
,Appendable
,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final byte[][]
protected static final ThreadLocal<SoftReference<byte[][]>>
ThisThreadLocal
contains aSoftReference
to a byte array used for holding content to decodeprivate OutputStream
private byte[]
private final int
private int
(package private) int
When outputting chars from BMP, surrogate pairs need to be coalesced.private static final int
(package private) static final int
(package private) static final int
(package private) static final int
(package private) static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static byte[][]
append
(char c) void
close()
private int
convertSurrogate
(int secondPart) Method called to calculate UTF codepoint, from a surrogate pair.void
flush()
private void
throwIllegal
(int code) void
write
(char[] cbuf) void
write
(char[] cbuf, int off, int len) void
write
(int c) void
void
Methods inherited from class java.io.Writer
append, append, nullWriter
-
Field Details
-
SURR1_FIRST
static final int SURR1_FIRST- See Also:
-
SURR1_LAST
static final int SURR1_LAST- See Also:
-
SURR2_FIRST
static final int SURR2_FIRST- See Also:
-
SURR2_LAST
static final int SURR2_LAST- See Also:
-
DEFAULT_BUFFER_SIZE
private static final int DEFAULT_BUFFER_SIZE- See Also:
-
_bufferRecycler
ThisThreadLocal
contains aSoftReference
to a byte array used for holding content to decode -
_bufferHolder
protected final byte[][] _bufferHolder -
_out
-
_outBuffer
private byte[] _outBuffer -
_outBufferEnd
private final int _outBufferEnd -
_outPtr
private int _outPtr -
_surrogate
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
-
_findBufferHolder
private static byte[][] _findBufferHolder() -
append
- Specified by:
append
in interfaceAppendable
- Overrides:
append
in classWriter
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classWriter
- Throws:
IOException
-
flush
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
- Specified by:
write
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
- Overrides:
write
in classWriter
- Throws:
IOException
-
convertSurrogate
Method called to calculate UTF codepoint, from a surrogate pair.- Throws:
IOException
-
throwIllegal
- Throws:
IOException
-