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

public abstract Class SingleByteXmlWriter

extends ByteXmlWriter
Class Inheritance
Known Direct Subclasses
com.fasterxml.aalto.out.AsciiXmlWriter, com.fasterxml.aalto.out.Latin1XmlWriter
Imports
java.io.*, javax.xml.stream.*, com.fasterxml.aalto.util.XmlCharTypes

This is the common base class for writers that output to byte-backed output sources, and use Ascii or ISO-8859-1 (Latin1) encoding.

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
public abstract 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 inputOffset, int inputLen)

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

This can be done, although only by using character entities.
protected final int
outputStrictMultiByteChar(int ch, char[] cbuf, int inputOffset, int inputLen)

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

With single byte encodings, there's no way to express these characters without 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 abstract 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_releaseBufferscalcSurrogateconstructNameconstructNamedoConstructNamedoConstructNamefastWriteAttrValueflushflushBuffergetAsciigetAsciigetAsciigetOutputPtrthrowUnpairedSurrogatethrowUnpairedSurrogateverifyNameComponentwriteAsEntitywriteAttributewriteAttributewriteAttributewriteAttrValuewriteCDatawriteCDatawriteCDataContentswriteCDataEndwriteCDataStartwriteCharacterswriteCharacterswriteCommentwriteCommentContentswriteCommentEndwriteCommentStartwriteDTDwriteDTDwriteEndTagwriteEntityReferencewriteLongAttributewriteNamewriteNamewriteNamewritePIwritePIDatawriteRawwriteRawwriteRawwriteRawwriteRawwriteSpacewriteSpacewriteStartTagEmptyEndwriteStartTagEndwriteStartTagStartwriteTypedValuewriteXmlDeclaration

Constructor Detail

SingleByteXmlWriterback to summary
public SingleByteXmlWriter(WriterConfig cfg, OutputStream out, XmlCharTypes charTypes)

Method Detail

getHighestEncodableback to summary
public abstract 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.

This can be done, although only by using character entities.

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.

With single byte encodings, there's no way to express these characters without character entities. So, this always leads to an exception

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 abstract 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