Top Description Fields Constructors Methods
com.ctc.wstx.sw

public final Class BufferingXmlWriter

extends XmlWriter
implements XMLStreamConstants
Class Inheritance
All Implemented Interfaces
javax.xml.stream.XMLStreamConstants
Imports
java.io.IOException, .OutputStream, .Writer, java.util.Arrays, javax.xml.stream.XMLStreamConstants, .XMLStreamException, org.codehaus.stax2.ri.typed.AsciiValueEncoder, org.codehaus.stax2.validation.XMLValidator, com.ctc.wstx.api.WriterConfig, com.ctc.wstx.io.CharsetNames, .CompletelyCloseable

Concrete implementation of XmlWriter that will dispatch writes to another writer (of type java.io.Writer, and will NOT handle encoding. It will, however, do basic buffering such that the underlying Writer need (and thus, should) not do buffering.

One design goal for this class is to avoid unnecessary buffering: since there will be another Writer doing the actual encoding, amount of buffering needed should still be limited. To this end, a threshold is used to define what's the threshold of writes that we do want to coalesce, ie. buffer. Writes bigger than this should in general proceed without buffering.

Field Summary

Modifier and TypeField and Description
pack-priv static final int
DEFAULT_BUFFER_SIZE

Let's use a typical default to have a compromise between large enough chunks to output, and minimizing memory overhead.

pack-priv static final int
DEFAULT_SMALL_SIZE

Choosing threshold for 'small size' is a compromise between excessive buffering (high small size), and too many fragmented calls to the underlying writer (low small size).

protected static final int
HIGHEST_ENCODABLE_ATTR_CHAR

Highest valued character that may need to be encoded (minus charset encoding requirements) when writing attribute values.

protected static final int
HIGHEST_ENCODABLE_TEXT_CHAR

Highest valued character that may need to be encoded (minus charset encoding requirements) when writing attribute values.

private final int
mEncHighChar

First Unicode character (one with lowest value) after (and including) which character entities have to be used.

pack-priv final char
mEncQuoteChar

Character that is considered to be the enclosing quote character; for XML either single or double quote.

pack-priv final String
mEncQuoteEntity

Entity String to use for escaping the quote character.

protected final Writer
mOut

Actual Writer to use for outputting buffered data as appropriate.

protected char[]
protected int
protected int
protected final int
mSmallWriteSize

This is the threshold used to check what is considered a "small" write; small writes will be buffered until resulting size will be above the threshold.

protected final OutputStream
mUnderlyingStream

Actual physical stream that the writer is using, if known.

protected static final int[]
Inherited from com.ctc.wstx.sw.XmlWriter:
DEFAULT_QUOTE_CHARmAddSpaceAfterEmptyElemmAttrValueWritermAutoCloseOutputmCheckContentmCheckNamesmCheckStructuremConfigmEncodingmEscapeCRmFixContentmLocPastCharsmLocRowNrmLocRowStartOffsetmNsAwaremRawWrappermTextWrappermTextWritermUseDoubleQuotesInXmlDeclmXml11SURR1_FIRSTSURR1_LASTSURR2_FIRSTSURR2_LAST

Constructor Summary

AccessConstructor and Description
public
BufferingXmlWriter(Writer out, WriterConfig cfg, String enc, boolean autoclose, OutputStream
Underlying OutputStream that the writer (out) is using, if known. Needed to support (optional) access to the underlying stream
outs
,
int bitsize)

Method Summary

Modifier and TypeMethod and Description
public void
close(boolean forceRealClose)

Implements abstract com.ctc.wstx.sw.XmlWriter.close.

Method called to flush the buffer(s), and close the output sink (stream or writer) if enabled (auto-closing) or forced.

private final void
fastWriteRaw(char c)

private final void
fastWriteRaw(char c1, char c2)

private final void
public final void
flush()

Implements abstract com.ctc.wstx.sw.XmlWriter.flush.

private final void
protected int
protected final OutputStream
protected final Writer
public static int
guessEncodingBitSize(String enc)

Method used to figure out which part of the Unicode char set the encoding can natively support.

protected int

Returns:

Index at which a problem was found, if any; -1 if there's no problem.
verifyCDataContent
(String content)

protected int
verifyCDataContent(char[] c, int start, int end)

protected int
protected final void
public void
writeAttribute(String localName, String value)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeAttribute.

Note

can throw XMLStreamException, if name checking is enabled, and name is invalid (name check has to be in this writer, not caller, since it depends not only on xml limitations, but also on encoding limitations)

public void
writeAttribute(String localName, char[] value, int offset, int vlen)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeAttribute.

public void
writeAttribute(String prefix, String localName, String value)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeAttribute.

Note

can throw XMLStreamException, if name checking is enabled, and name is invalid (name check has to be in this writer, not caller, since it depends not only on xml limitations, but also on encoding limitations)

public void
writeAttribute(String prefix, String localName, char[] value, int offset, int vlen)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeAttribute.

private final void
writeAttrValue(String value, int len)

private final void
writeAttrValue(char[] value, int offset, int len)

public int
writeCData(String
Contents of the CDATA section to write out
data
)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeCData.

public int
writeCData(char[] cbuf, int offset, int len)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeCData.

public final void
public final void
public void
public void
writeCharacters(char[] cbuf, int offset, int len)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeCharacters.

public int
writeComment(String data)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeComment.

Method that will try to output the content as specified.

public final void
public final void
public void
writeDTD(String data)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeDTD.

Older "legacy" output method for outputting DOCTYPE declaration.

public void
writeDTD(String rootName, String systemId, String publicId, String internalSubset)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeDTD.

public void
public void
writeEndTag(String prefix, String localName)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeEndTag.

public void
public int
writePI(String target, String data)

Implements abstract com.ctc.wstx.sw.XmlWriter.writePI.

public final void
public final void
writePIStart(String target, boolean addSpace)

Implements abstract com.ctc.wstx.sw.XmlWriter.writePIStart.

protected final void
writePrefixedName(String prefix, String localName)

public void
writeRaw(char[] cbuf, int offset, int len)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeRaw.

public void
public void
writeRaw(String str, int offset, int len)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeRaw.

public final void
writeRawAscii(char[] cbuf, int offset, int len)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeRawAscii.

Method called to output typed values (int, long, double, float etc) that are known not to contain any escapable characters, or anything else beyond 7-bit ascii range.

protected void
writeSegmentedCData(String content, int index)

protected void
writeSegmentedCData(char[] c, int start, int len, int index)

protected void
writeSegmentedComment(String content, int index)

public void
public void
public void
writeStartTagStart(String localName)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeStartTagStart.

Note

can throw XMLStreamException, if name checking is enabled, and name is invalid (name check has to be in this writer, not caller, since it depends not only on xml limitations, but also on encoding limitations)

public void
writeStartTagStart(String prefix, String localName)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeStartTagStart.

Note

can throw XMLStreamException, if name checking is enabled, and name is invalid (name check has to be in this writer, not caller, since it depends not only on xml limitations, but also on encoding limitations)

public void
writeTypedAttribute(String localName, AsciiValueEncoder enc)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeTypedAttribute.

Method similar to writeAttribute(String, String, char[], int, int) but where is known not to require escaping.

public void
writeTypedAttribute(String prefix, String localName, AsciiValueEncoder enc)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeTypedAttribute.

Method similar to writeAttribute(String, String, char[], int, int) but where is known not to require escaping.

public void
writeTypedAttribute(String prefix, String localName, String nsURI, AsciiValueEncoder enc, XMLValidator validator, char[] copyBuffer)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeTypedAttribute.

Method similar to writeAttribute(String, String, char[], int, int) but where is known not to require escaping.

public final void
writeTypedElement(AsciiValueEncoder
Encoder that will produce content
enc
)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeTypedElement.

Like writeRaw, but caller guarantees that the contents additionally are known to be in 7-bit ascii range, and also passes an encoder object that will encode values only when being handed a buffer to append to.

public final void
writeTypedElement(AsciiValueEncoder
Encoder that will produce content
enc
,
XMLValidator
Validator to use for validating serialized textual content (can not be null)
validator
,
char[]
Temporary buffer that writer can use for temporary copies as necessary
copyBuffer
)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeTypedElement.

Like writeRaw, but caller guarantees that the contents additionally are known to be in 7-bit ascii range, and also passes an encoder object that will encode values only when being handed a buffer to append to.

public void
writeXmlDeclaration(String version, String encoding, String standalone)

Implements abstract com.ctc.wstx.sw.XmlWriter.writeXmlDeclaration.

Inherited from com.ctc.wstx.sw.XmlWriter:
enableXml11getAbsOffsetgetColumngetRowhandleInvalidCharreportNwfContentreportNwfNamethrowOutputErrorthrowOutputErrorverifyNameValiditywrapAsRawWriterwrapAsTextWriter

Field Detail

DEFAULT_BUFFER_SIZEback to summary
pack-priv static final int DEFAULT_BUFFER_SIZE

Let's use a typical default to have a compromise between large enough chunks to output, and minimizing memory overhead. Compared to encoding writers, buffer size can be bit smaller since there's one more level of processing (at encoding), which may use bigger buffering.

DEFAULT_SMALL_SIZEback to summary
pack-priv static final int DEFAULT_SMALL_SIZE

Choosing threshold for 'small size' is a compromise between excessive buffering (high small size), and too many fragmented calls to the underlying writer (low small size). Let's just use about 1/4 of the full buffer size.

HIGHEST_ENCODABLE_ATTR_CHARback to summary
protected static final int HIGHEST_ENCODABLE_ATTR_CHAR

Highest valued character that may need to be encoded (minus charset encoding requirements) when writing attribute values.

HIGHEST_ENCODABLE_TEXT_CHARback to summary
protected static final int HIGHEST_ENCODABLE_TEXT_CHAR

Highest valued character that may need to be encoded (minus charset encoding requirements) when writing attribute values.

mEncHighCharback to summary
private final int mEncHighChar

First Unicode character (one with lowest value) after (and including) which character entities have to be used. For

mEncQuoteCharback to summary
pack-priv final char mEncQuoteChar

Character that is considered to be the enclosing quote character; for XML either single or double quote.

mEncQuoteEntityback to summary
pack-priv final String mEncQuoteEntity

Entity String to use for escaping the quote character.

mOutback to summary
protected final Writer mOut

Actual Writer to use for outputting buffered data as appropriate.

mOutputBufferback to summary
protected char[] mOutputBuffer
mOutputBufLenback to summary
protected int mOutputBufLen
mOutputPtrback to summary
protected int mOutputPtr
mSmallWriteSizeback to summary
protected final int mSmallWriteSize

This is the threshold used to check what is considered a "small" write; small writes will be buffered until resulting size will be above the threshold.

mUnderlyingStreamback to summary
protected final OutputStream mUnderlyingStream

Actual physical stream that the writer is using, if known. Not used for actual output, only needed so that calling application may (try to) figure out the original source.

QUOTABLE_TEXT_CHARSback to summary
protected static final int[] QUOTABLE_TEXT_CHARS

Constructor Detail

BufferingXmlWriterback to summary
public BufferingXmlWriter(Writer out, WriterConfig cfg, String enc, boolean autoclose, OutputStream outs, int bitsize) throws IOException
Parameters
outs:OutputStream

Underlying OutputStream that the writer (out) is using, if known. Needed to support (optional) access to the underlying stream

Method Detail

closeback to summary
public void close(boolean forceRealClose) throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.close.

Doc from com.ctc.wstx.sw.XmlWriter.close.

Method called to flush the buffer(s), and close the output sink (stream or writer) if enabled (auto-closing) or forced.

Annotations
@Override
fastWriteRawback to summary
private final void fastWriteRaw(char c) throws IOException
fastWriteRawback to summary
private final void fastWriteRaw(char c1, char c2) throws IOException
fastWriteRawback to summary
private final void fastWriteRaw(String str) throws IOException
flushback to summary
public final void flush() throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.flush.

Annotations
@Override
flushBufferback to summary
private final void flushBuffer() throws IOException
getOutputPtrback to summary
protected int getOutputPtr()

Implements abstract com.ctc.wstx.sw.XmlWriter.getOutputPtr.

Annotations
@Override
getOutputStreamback to summary
protected final OutputStream getOutputStream()

Implements abstract com.ctc.wstx.sw.XmlWriter.getOutputStream.

Returns:OutputStream

Doc from com.ctc.wstx.sw.XmlWriter.getOutputStream.

Underlying OutputStream used for physical output, if the writer was constructed using one

Annotations
@Override
getWriterback to summary
protected final Writer getWriter()

Implements abstract com.ctc.wstx.sw.XmlWriter.getWriter.

Returns:Writer

Doc from com.ctc.wstx.sw.XmlWriter.getWriter.

Underlying Writer used for physical output, if the writer was constructed with one, or one was created to be used with an OutputStream.

Annotations
@Override
guessEncodingBitSizeback to summary
public static int guessEncodingBitSize(String enc)

Method used to figure out which part of the Unicode char set the encoding can natively support. Values returned are 7, 8 and 16, to indicate (respectively) "ascii", "ISO-Latin" and "native Unicode". These just best guesses, but should work ok for the most common encodings.

verifyCDataContentback to summary
protected int verifyCDataContent(String content)
Returns:int

Index at which a problem was found, if any; -1 if there's no problem.

verifyCDataContentback to summary
protected int verifyCDataContent(char[] c, int start, int end)
verifyCommentContentback to summary
protected int verifyCommentContent(String content)
writeAsEntityback to summary
protected final void writeAsEntity(int c) throws IOException
writeAttributeback to summary
public void writeAttribute(String localName, String value) throws IOException, XMLStreamException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeAttribute.

Doc from com.ctc.wstx.sw.XmlWriter.writeAttribute.

Note

can throw XMLStreamException, if name checking is enabled, and name is invalid (name check has to be in this writer, not caller, since it depends not only on xml limitations, but also on encoding limitations)

Annotations
@Override
writeAttributeback to summary
public void writeAttribute(String localName, char[] value, int offset, int vlen) throws IOException, XMLStreamException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeAttribute.

Annotations
@Override
writeAttributeback to summary
public void writeAttribute(String prefix, String localName, String value) throws IOException, XMLStreamException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeAttribute.

Doc from com.ctc.wstx.sw.XmlWriter.writeAttribute.

Note

can throw XMLStreamException, if name checking is enabled, and name is invalid (name check has to be in this writer, not caller, since it depends not only on xml limitations, but also on encoding limitations)

Annotations
@Override
writeAttributeback to summary
public void writeAttribute(String prefix, String localName, char[] value, int offset, int vlen) throws IOException, XMLStreamException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeAttribute.

Annotations
@Override
writeAttrValueback to summary
private final void writeAttrValue(String value, int len) throws IOException
writeAttrValueback to summary
private final void writeAttrValue(char[] value, int offset, int len) throws IOException
writeCDataback to summary
public int writeCData(String data) throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeCData.

Parameters
data:String

Doc from com.ctc.wstx.sw.XmlWriter.writeCData.

Contents of the CDATA section to write out

Returns:int

Doc from com.ctc.wstx.sw.XmlWriter.writeCData.

offset of the (first) illegal content segment ("]]>") in passed content and not in repairing mode; or -1 if none or is repairing

Annotations
@Override
writeCDataback to summary
public int writeCData(char[] cbuf, int offset, int len) throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeCData.

Annotations
@Override
writeCDataEndback to summary
public final void writeCDataEnd() throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeCDataEnd.

Annotations
@Override
writeCDataStartback to summary
public final void writeCDataStart() throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeCDataStart.

Annotations
@Override
writeCharactersback to summary
public void writeCharacters(String text) throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeCharacters.

Annotations
@Override
writeCharactersback to summary
public void writeCharacters(char[] cbuf, int offset, int len) throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeCharacters.

Annotations
@Override
writeCommentback to summary
public int writeComment(String data) throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeComment.

Method that will try to output the content as specified. If the content passed in has embedded "--" in it, it will either add an intervening space between consequtive hyphens (if content fixing is enabled), or return the offset of the first hyphen in multi-hyphen sequence.

Annotations
@Override
writeCommentEndback to summary
public final void writeCommentEnd() throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeCommentEnd.

Annotations
@Override
writeCommentStartback to summary
public final void writeCommentStart() throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeCommentStart.

Annotations
@Override
writeDTDback to summary
public void writeDTD(String data) throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeDTD.

Doc from com.ctc.wstx.sw.XmlWriter.writeDTD.

Older "legacy" output method for outputting DOCTYPE declaration. Assumes that the passed-in String contains a complete DOCTYPE declaration properly quoted.

Annotations
@Override
writeDTDback to summary
public void writeDTD(String rootName, String systemId, String publicId, String internalSubset) throws IOException, XMLStreamException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeDTD.

Annotations
@Override
writeEndTagback to summary
public void writeEndTag(String localName) throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeEndTag.

Annotations
@Override
writeEndTagback to summary
public void writeEndTag(String prefix, String localName) throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeEndTag.

Annotations
@Override
writeEntityReferenceback to summary
public void writeEntityReference(String name) throws IOException, XMLStreamException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeEntityReference.

Annotations
@Override
writePIback to summary
public int writePI(String target, String data) throws IOException, XMLStreamException

Implements abstract com.ctc.wstx.sw.XmlWriter.writePI.

Annotations
@Override
writePIEndback to summary
public final void writePIEnd() throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writePIEnd.

Annotations
@Override
writePIStartback to summary
public final void writePIStart(String target, boolean addSpace) throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writePIStart.

Annotations
@Override
writePrefixedNameback to summary
protected final void writePrefixedName(String prefix, String localName) throws IOException
writeRawback to summary
public void writeRaw(char[] cbuf, int offset, int len) throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeRaw.

Annotations
@Override
writeRawback to summary
public void writeRaw(String str) throws IOException

Overrides com.ctc.wstx.sw.XmlWriter.writeRaw.

Annotations
@Override
writeRawback to summary
public void writeRaw(String str, int offset, int len) throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeRaw.

Annotations
@Override
writeRawAsciiback to summary
public final void writeRawAscii(char[] cbuf, int offset, int len) throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeRawAscii.

Method called to output typed values (int, long, double, float etc) that are known not to contain any escapable characters, or anything else beyond 7-bit ascii range.

Annotations
@Override
writeSegmentedCDataback to summary
protected void writeSegmentedCData(String content, int index) throws IOException
writeSegmentedCDataback to summary
protected void writeSegmentedCData(char[] c, int start, int len, int index) throws IOException
writeSegmentedCommentback to summary
protected void writeSegmentedComment(String content, int index) throws IOException
writeStartTagEmptyEndback to summary
public void writeStartTagEmptyEnd() throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeStartTagEmptyEnd.

Annotations
@Override
writeStartTagEndback to summary
public void writeStartTagEnd() throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeStartTagEnd.

Annotations
@Override
writeStartTagStartback to summary
public void writeStartTagStart(String localName) throws IOException, XMLStreamException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeStartTagStart.

Doc from com.ctc.wstx.sw.XmlWriter.writeStartTagStart.

Note

can throw XMLStreamException, if name checking is enabled, and name is invalid (name check has to be in this writer, not caller, since it depends not only on xml limitations, but also on encoding limitations)

Annotations
@Override
writeStartTagStartback to summary
public void writeStartTagStart(String prefix, String localName) throws IOException, XMLStreamException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeStartTagStart.

Doc from com.ctc.wstx.sw.XmlWriter.writeStartTagStart.

Note

can throw XMLStreamException, if name checking is enabled, and name is invalid (name check has to be in this writer, not caller, since it depends not only on xml limitations, but also on encoding limitations)

Annotations
@Override
writeTypedAttributeback to summary
public void writeTypedAttribute(String localName, AsciiValueEncoder enc) throws IOException, XMLStreamException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeTypedAttribute.

Doc from com.ctc.wstx.sw.XmlWriter.writeTypedAttribute.

Method similar to writeAttribute(String, String, char[], int, int) but where is known not to require escaping. No validation needs to be performed.

Annotations
@Override
writeTypedAttributeback to summary
public void writeTypedAttribute(String prefix, String localName, AsciiValueEncoder enc) throws IOException, XMLStreamException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeTypedAttribute.

Doc from com.ctc.wstx.sw.XmlWriter.writeTypedAttribute.

Method similar to writeAttribute(String, String, char[], int, int) but where is known not to require escaping. No validation needs to be performed.

Annotations
@Override
writeTypedAttributeback to summary
public void writeTypedAttribute(String prefix, String localName, String nsURI, AsciiValueEncoder enc, XMLValidator validator, char[] copyBuffer) throws IOException, XMLStreamException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeTypedAttribute.

Doc from com.ctc.wstx.sw.XmlWriter.writeTypedAttribute.

Method similar to writeAttribute(String, String, char[], int, int) but where is known not to require escaping. Validation of the attribute value must be done by calling given validator appropriately.

Annotations
@Override
writeTypedElementback to summary
public final void writeTypedElement(AsciiValueEncoder enc) throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeTypedElement.

Doc from com.ctc.wstx.sw.XmlWriter.writeTypedElement.

Like writeRaw, but caller guarantees that the contents additionally are known to be in 7-bit ascii range, and also passes an encoder object that will encode values only when being handed a buffer to append to.

Parameters
enc:AsciiValueEncoder

Encoder that will produce content

Annotations
@Override
writeTypedElementback to summary
public final void writeTypedElement(AsciiValueEncoder enc, XMLValidator validator, char[] copyBuffer) throws IOException, XMLStreamException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeTypedElement.

Doc from com.ctc.wstx.sw.XmlWriter.writeTypedElement.

Like writeRaw, but caller guarantees that the contents additionally are known to be in 7-bit ascii range, and also passes an encoder object that will encode values only when being handed a buffer to append to.

Parameters
enc:AsciiValueEncoder

Encoder that will produce content

validator:XMLValidator

Validator to use for validating serialized textual content (can not be null)

copyBuffer:char[]

Temporary buffer that writer can use for temporary copies as necessary

Annotations
@Override
writeXmlDeclarationback to summary
public void writeXmlDeclaration(String version, String encoding, String standalone) throws IOException

Implements abstract com.ctc.wstx.sw.XmlWriter.writeXmlDeclaration.

Annotations
@Override