Interface StreamProvider


  • public interface StreamProvider
    Service lookup is used to find implementations of this interface. It contains the methods to instance different encoders/decoders and other streams required by the API.
    Since:
    JavaMail 2.1
    • Method Detail

      • inputBase64

        InputStream inputBase64​(InputStream in)
        Creates a 'base64' decoder from the InputStream.
        Parameters:
        in - the InputStream
        Returns:
        the decoder
      • outputBase64

        OutputStream outputBase64​(OutputStream out)
        Creates a 'base64' encoder from the OutputStream.
        Parameters:
        out - the OutputStream
        Returns:
        the encoder
      • inputBinary

        InputStream inputBinary​(InputStream in)
        Creates a 'binary', '7bit' and '8bit' decoder from the InputStream.
        Parameters:
        in - the InputStream
        Returns:
        the decoder
      • outputBinary

        OutputStream outputBinary​(OutputStream out)
        Creates a 'binary', '7bit' and '8bit' encoder from the OutputStream.
        Parameters:
        out - the OutputStream
        Returns:
        the encoder
      • outputB

        OutputStream outputB​(OutputStream out)
        Creates a 'b' encoder from the OutputStream.
        Parameters:
        out - the OutputStream
        Returns:
        the encoder
      • inputQ

        InputStream inputQ​(InputStream in)
        Creates a 'q' decoder from the InputStream.
        Parameters:
        in - the InputStream
        Returns:
        the decoder
      • outputQ

        OutputStream outputQ​(OutputStream out,
                             boolean encodingWord)
        Creates a 'q' encoder.
        Parameters:
        out - the OutputStream
        encodingWord - true if we are Q-encoding a word within a phrase.
        Returns:
        the encoder
      • inputLineStream

        LineInputStream inputLineStream​(InputStream in,
                                        boolean allowutf8)
        Creates a new LineInputStream that supports reading CRLF terminated lines containing only US-ASCII characters from an input stream
        Parameters:
        in - the InputStream
        allowutf8 - allow UTF-8 characters?
        Returns:
        the LineInputStream
      • outputLineStream

        LineOutputStream outputLineStream​(OutputStream out,
                                          boolean allowutf8)
        Creates a new LineOutputStream that supports writing out Strings as a sequence of bytes terminated by a CRLF sequence. The String must contain only US-ASCII characters.
        Parameters:
        out - the OutputStream
        allowutf8 - allow UTF-8 characters?
        Returns:
        the LineOutputStream
      • inputQP

        InputStream inputQP​(InputStream in)
        Creates a 'quoted-printable' decoder from the InputStream.
        Parameters:
        in - the InputStream
        Returns:
        the decoder
      • outputQP

        OutputStream outputQP​(OutputStream out)
        Creates a 'quoted-printable' encoder from the OutputStream.
        Parameters:
        out - the OutputStream
        Returns:
        the encoder
      • inputSharedByteArray

        InputStream inputSharedByteArray​(byte[] buff)
        Creates a new InputStream from the underlying byte array to be shared between multiple readers.
        Parameters:
        buff - the byte array
        Returns:
        the InputStream
      • inputUU

        InputStream inputUU​(InputStream in)
        Creates a 'uuencode', 'x-uuencode' and 'x-uue' decoder from the InputStream.
        Parameters:
        in - the InputStream
        Returns:
        the decoder
      • outputUU

        OutputStream outputUU​(OutputStream out,
                              String filename)
        Creates a 'uuencode', 'x-uuencode' and 'x-uue' encoder from the OutputStream.
        Parameters:
        out - the OutputStream
        filename - Specifies a name for the encoded buffer. It can be null.
        Returns:
        the encoder
      • provider

        static StreamProvider provider()
        Creates a stream provider object. The provider is loaded using the ServiceLoader.load(Class) method. If there are no available service providers, this method throws an IllegalStateException. Users are recommended to cache the result of this method.
        Returns:
        a stream provider