Package org.bzdev.io

Class FISOutputStream

All Implemented Interfaces:
Closeable, Flushable, AutoCloseable

@Deprecated public class FISOutputStream extends FilterOutputStream
Deprecated.
Output stream for an XML fast info set. This class is deprecated as of Java 11 because Java 11 does not allow access to the class com.xml.internal.fastinfoset.sax.SAXDocumentSerializer. For Java-8 or earlier, use the following instructions.

It is the caller's responsibility to use this class's "write" methods to pass a valid XML document to an instance of this class, including anything loaded externally (e.g., an external DTD). When an XML document is fully read, this class will automatically flush and close the underlying output stream.

Warning: this class instantiates the class com.sun.xml.internal.fastinfoset.sax.SAXDocumentSerializer, which is provided in the JDK (at least, at the time this documentation was written), but for some unknown reason, the OpenJDK compiler will not recognize the package "com.sun.xml.internal.fastinfoset.sax" when used in an import statement in spite of it being present in the system JAR file. Oddly, one can create an instance of the SAXDocumentSrializer class by using the reflection API.

Because of this odd behavior, one should refrain from writing applications that are dependent on this class working as expected as it may disappear or have to be modified in subsequent JDK releases.

The static method isSupported() can be used to determine if this class is supported on a particular JDK or JRE.

  • Constructor Details

  • Method Details

    • isSupported

      public static boolean isSupported()
      Deprecated.
      Test if the fast infoset format is supported by the JRE. The fast infoset format is assumed to be supported if the class file for com.sun.xml.internal.fastinfoset.sax.SAXDocumentSerializer can be loaded.
      Returns:
      true if it is supported; false otherwise
    • close

      public void close() throws IOException
      Deprecated.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class FilterOutputStream
      Throws:
      IOException