XmlEncodingSniffer (xmlbeans API)

org.apache.xmlbeans.impl.common

## Class XmlEncodingSniffer

- java.lang.Object
- - org.apache.xmlbeans.impl.common.XmlEncodingSniffer

-     public class XmlEncodingSniffer
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XmlEncodingSniffer(Reader reader, String encodingDefault)` Sniffs the given XML stream for encoding information.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getJavaEncoding()`
    `Reader` | `getReader()`
    `InputStream` | `getStream()`
    `String` | `getXmlEncoding()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### XmlEncodingSniffer

          public XmlEncodingSniffer(Reader reader,
                                    String encodingDefault)
                             throws IOException,
                                    UnsupportedEncodingException

      Sniffs the given XML stream for encoding information. After a sniffer is constructed, it can return either a reader (which is a buffered stream wrapper of the original) or a stream (which applies the proper encoding).
      Parameters:
        `reader` - The reader to sniff
        `encodingDefault` - The Java name for the default encoding to apply, UTF-8 if null.
      Throws:
        `IOException`
        `UnsupportedEncodingException`

  - ### Method Detail

    - #### getXmlEncoding

          public String getXmlEncoding()

    - #### getJavaEncoding

          public String getJavaEncoding()

    - #### getStream

          public InputStream getStream()
                                throws UnsupportedEncodingException

      Throws:
        `UnsupportedEncodingException`

    - #### getReader

          public Reader getReader()
                           throws UnsupportedEncodingException

      Throws:
        `UnsupportedEncodingException`