Top Description Fields Constructors Methods
com.fasterxml.aalto.out

public final Class Utf8XmlWriter

extends ByteXmlWriter
Class Inheritance
Imports
java.io.*, javax.xml.stream.*, com.fasterxml.aalto.impl.IoStreamException, com.fasterxml.aalto.util.XmlConsts

This is the generic implementation of XmlWriter, used if the destination is byte-based java.io.OutputStream, and encoding is UTF-8.

Field Summary

Inherited from com.fasterxml.aalto.out.ByteXmlWriter:
_charTypes_out_outputBuffer_outputBufferLen_outputPtr_surrogateBYTE_ABYTE_AMPBYTE_APOSBYTE_COLONBYTE_EQBYTE_GBYTE_GTBYTE_HASHBYTE_HYPHENBYTE_LBYTE_LBRACKETBYTE_LTBYTE_MBYTE_OBYTE_PBYTE_QBYTE_QMARKBYTE_QUOTBYTE_RBRACKETBYTE_SBYTE_SEMICOLONBYTE_SLASHBYTE_SPACEBYTE_TBYTE_UBYTE_XBYTES_CDATA_ENDBYTES_CDATA_STARTBYTES_COMMENT_ENDBYTES_COMMENT_STARTBYTES_XMLDECL_ENCODINGBYTES_XMLDECL_STANDALONEBYTES_XMLDECL_STARTDEFAULT_COPY_BUFFER_SIZEDEFAULT_FULL_BUFFER_SIZESMALL_WRITE

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected WName
protected WName
public int
getHighestEncodable()

Implements abstract com.fasterxml.aalto.out.XmlWriter.getHighestEncodable.

Method called by error reporting code, to figure out if a given character is encodable (without using character entities) with the current encoding or not.
protected final void
protected final int
outputMultiByteChar(int ch, char[] cbuf, int
Input pointer after character has been handled; either same as one passed in, or one more if a surrogate character was succesfully handled
inputOffset
,
int inputLen)

Implements abstract com.fasterxml.aalto.out.ByteXmlWriter.outputMultiByteChar.

Method called to output a character that is beyond range of 1- and 2-byte UTF-8 encodings.
protected final int
outputStrictMultiByteChar(int ch, char[] cbuf, int inputOffset, int inputLen)

Implements abstract com.fasterxml.aalto.out.ByteXmlWriter.outputStrictMultiByteChar.

Method called to output a character beyond basic 1- or 2-byte encoding (code 0x0800 and above), without being able to use character entities
protected final void
outputSurrogates(int surr1, int surr2)

Implements abstract com.fasterxml.aalto.out.ByteXmlWriter.outputSurrogates.

Method called to output a composite character, result of combining 2 surrogate characters.
public void
writeRaw(char[] cbuf, int offset, int len)

Implements abstract com.fasterxml.aalto.out.ByteXmlWriter.writeRaw.

This method is heavily encoding-dependant, so it needs to be deferred to sub-classes
Inherited from com.fasterxml.aalto.out.ByteXmlWriter:
_closeTarget_releaseBufferscalcSurrogateconstructNameconstructNamefastWriteAttrValueflushflushBuffergetAsciigetAsciigetAsciigetOutputPtrthrowUnpairedSurrogatethrowUnpairedSurrogateverifyNameComponentwriteAsEntitywriteAttributewriteAttributewriteAttributewriteAttrValuewriteCDatawriteCDatawriteCDataContentswriteCDataEndwriteCDataStartwriteCharacterswriteCharacterswriteCommentwriteCommentContentswriteCommentEndwriteCommentStartwriteDTDwriteDTDwriteEndTagwriteEntityReferencewriteLongAttributewriteNamewriteNamewriteNamewritePIwritePIDatawriteRawwriteRawwriteRawwriteRawwriteRawwriteSpacewriteSpacewriteStartTagEmptyEndwriteStartTagEndwriteStartTagStartwriteTypedValuewriteXmlDeclaration

Constructor Detail

Utf8XmlWriterback to summary
public Utf8XmlWriter(WriterConfig cfg, OutputStream out)

Method Detail

doConstructNameback to summary
protected WName doConstructName(String localName) throws XMLStreamException

Implements abstract com.fasterxml.aalto.out.ByteXmlWriter.doConstructName.

Annotations
@Override
doConstructNameback to summary
protected WName doConstructName(String prefix, String localName) throws XMLStreamException

Implements abstract com.fasterxml.aalto.out.ByteXmlWriter.doConstructName.

Annotations
@Override
getHighestEncodableback to summary
public int getHighestEncodable()

Implements abstract com.fasterxml.aalto.out.XmlWriter.getHighestEncodable.

Doc from com.fasterxml.aalto.out.XmlWriter.getHighestEncodable.

Method called by error reporting code, to figure out if a given character is encodable (without using character entities) with the current encoding or not.

Returns:int

Character code of the highest character that can be natively encoded.

Annotations
@Override
output2ByteCharback to summary
protected final void output2ByteChar(int ch) throws IOException, XMLStreamException

Implements abstract com.fasterxml.aalto.out.ByteXmlWriter.output2ByteChar.

Annotations
@Override
outputMultiByteCharback to summary
protected final int outputMultiByteChar(int ch, char[] cbuf, int inputOffset, int inputLen) throws IOException, XMLStreamException

Implements abstract com.fasterxml.aalto.out.ByteXmlWriter.outputMultiByteChar.

Method called to output a character that is beyond range of 1- and 2-byte UTF-8 encodings. This means it's either invalid character, or needs to be encoded using 3- or 4-byte encoding.

Parameters
inputOffset:int

Input pointer after character has been handled; either same as one passed in, or one more if a surrogate character was succesfully handled

Annotations
@Override
outputStrictMultiByteCharback to summary
protected final int outputStrictMultiByteChar(int ch, char[] cbuf, int inputOffset, int inputLen) throws IOException, XMLStreamException

Implements abstract com.fasterxml.aalto.out.ByteXmlWriter.outputStrictMultiByteChar.

Doc from com.fasterxml.aalto.out.ByteXmlWriter.outputStrictMultiByteChar.

Method called to output a character beyond basic 1- or 2-byte encoding (code 0x0800 and above), without being able to use character entities

Annotations
@Override
outputSurrogatesback to summary
protected final void outputSurrogates(int surr1, int surr2) throws IOException, XMLStreamException

Implements abstract com.fasterxml.aalto.out.ByteXmlWriter.outputSurrogates.

Doc from com.fasterxml.aalto.out.ByteXmlWriter.outputSurrogates.

Method called to output a composite character, result of combining 2 surrogate characters.

Annotations
@Override
writeRawback to summary
public void writeRaw(char[] cbuf, int offset, int len) throws IOException, XMLStreamException

Implements abstract com.fasterxml.aalto.out.ByteXmlWriter.writeRaw.

Doc from com.fasterxml.aalto.out.ByteXmlWriter.writeRaw.

This method is heavily encoding-dependant, so it needs to be deferred to sub-classes

Annotations
@Override