Class text_plain

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  text_plain.NoCloseOutputStream
      An OuputStream wrapper that doesn't close the underlying stream.
    • Constructor Summary

      Constructors 
      Constructor Description
      text_plain()  
    • Constructor Detail

      • text_plain

        public text_plain()
    • Method Detail

      • getDataFlavors

        protected ActivationDataFlavor[] getDataFlavors()
        Description copied from class: handler_base
        Return an array of ActivationDataFlavors that we support. Usually there will be only one.
        Specified by:
        getDataFlavors in class handler_base
        Returns:
        array of ActivationDataFlavors that we support
      • getContent

        public java.lang.Object getContent​(DataSource ds)
                                    throws java.io.IOException
        Description copied from interface: DataContentHandler
        Return an object representing the data in its most preferred form. Generally this will be the form described by the first DataFlavor returned by the getTransferDataFlavors method.
        Parameters:
        ds - The DataSource representing the data to be converted.
        Returns:
        The constructed Object.
        Throws:
        java.io.IOException - if the data can't be accessed
      • writeTo

        public void writeTo​(java.lang.Object obj,
                            java.lang.String type,
                            java.io.OutputStream os)
                     throws java.io.IOException
        Write the object to the output stream, using the specified MIME type.
        Parameters:
        obj - The object to be converted.
        type - The requested MIME type of the resulting byte stream.
        os - The output stream into which to write the converted byte stream.
        Throws:
        java.io.IOException - errors writing to the stream
      • getCharset

        private java.lang.String getCharset​(java.lang.String type)