Package net.sf.saxon.serialize
Class UTF8Writer
java.lang.Object
java.io.Writer
net.sf.saxon.serialize.UTF8Writer
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
Specialized buffering UTF-8 writer.
The main reason for custom version is to allow for efficient
buffer recycling; the second benefit is that encoder has less
overhead for short content encoding (compared to JDK default
codecs).
- Author:
- Tatu Saloranta
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected OutputStreamprotected byte[]protected final intprotected int(package private) intWhen outputting chars from BMP, surrogate pairs need to be coalesced.(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
Methods inherited from class java.io.Writer
append, 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:
-
_out
-
_outBuffer
protected byte[] _outBuffer -
_outBufferLast
protected final int _outBufferLast -
_outPtr
protected 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
-
UTF8Writer
-
-
Method Details
-
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
-