APIdia Launch Partner
Top Fields Constructors Methods
jdk.internal.util.xml.impl

public Class XMLWriter

extends Object
Class Inheritance
Imports
java.io.BufferedOutputStream, .IOException, .OutputStream, .OutputStreamWriter, .UnsupportedEncodingException, .Writer, java.nio.charset.Charset, .CharsetEncoder, jdk.internal.util.xml.XMLStreamException

Author
huizwang

Field Summary

Modifier and TypeField and Description
private CharsetEncoder
_encoder

In some cases, this charset encoder is used to determine if a char is encodable by underlying writer.

private Writer

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canEncode(char ch)

pack-priv void
pack-priv void
private Writer

Returns:

A suitable writer
getWriter
(OutputStream
The output stream
output
,
String
The encoding
encoding
,
Charset cs)

Returns a writer for the specified encoding based on an output stream.

private void
nl()

public void
public void
write(String str, int off, int len)

public void
write(char[] cbuf, int off, int len)

pack-priv void
write(int b)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_encoderback to summary
private CharsetEncoder _encoder

In some cases, this charset encoder is used to determine if a char is encodable by underlying writer. For example, an 8-bit char from the extended ASCII set is not encodable by 7-bit ASCII encoder. Unencodable chars are escaped using XML numeric entities.

_writerback to summary
private Writer _writer

Constructor Detail

XMLWriterback to summary
public XMLWriter(OutputStream os, String encoding, Charset cs) throws XMLStreamException

Method Detail

canEncodeback to summary
public boolean canEncode(char ch)
closeback to summary
pack-priv void close() throws XMLStreamException
flushback to summary
pack-priv void flush() throws XMLStreamException
getWriterback to summary
private Writer getWriter(OutputStream output, String encoding, Charset cs) throws XMLStreamException, UnsupportedEncodingException

Returns a writer for the specified encoding based on an output stream.

Parameters
output:OutputStream

The output stream

encoding:String

The encoding

Returns:Writer

A suitable writer

Exceptions
UnsupportedEncodingException:
There is no converter to support this encoding
nlback to summary
private void nl() throws XMLStreamException
writeback to summary
public void write(String s) throws XMLStreamException
writeback to summary
public void write(String str, int off, int len) throws XMLStreamException
writeback to summary
public void write(char[] cbuf, int off, int len) throws XMLStreamException
writeback to summary
pack-priv void write(int b) throws XMLStreamException