Module jakarta.mail

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.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  StreamProvider.EncoderTypes
      Enumeration with the different encoder types supported by the Mail API.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.io.InputStream inputBase64​(java.io.InputStream in)
      Creates a 'base64' decoder from the InputStream.
      java.io.InputStream inputBinary​(java.io.InputStream in)
      Creates a 'binary', '7bit' and '8bit' decoder from the InputStream.
      LineInputStream inputLineStream​(java.io.InputStream in, boolean allowutf8)
      Creates a new LineInputStream that supports reading CRLF terminated lines containing only US-ASCII characters from an input stream
      java.io.InputStream inputQ​(java.io.InputStream in)
      Creates a 'q' decoder from the InputStream.
      java.io.InputStream inputQP​(java.io.InputStream in)
      Creates a 'quoted-printable' decoder from the InputStream.
      java.io.InputStream inputSharedByteArray​(byte[] buff)
      Creates a new InputStream from the underlying byte array to be shared between multiple readers.
      java.io.InputStream inputUU​(java.io.InputStream in)
      Creates a 'uuencode', 'x-uuencode' and 'x-uue' decoder from the InputStream.
      java.io.OutputStream outputB​(java.io.OutputStream out)
      Creates a 'b' encoder from the OutputStream.
      java.io.OutputStream outputBase64​(java.io.OutputStream out)
      Creates a 'base64' encoder from the OutputStream.
      java.io.OutputStream outputBinary​(java.io.OutputStream out)
      Creates a 'binary', '7bit' and '8bit' encoder from the OutputStream.
      LineOutputStream outputLineStream​(java.io.OutputStream out, boolean allowutf8)
      Creates a new LineOutputStream that supports writing out Strings as a sequence of bytes terminated by a CRLF sequence.
      java.io.OutputStream outputQ​(java.io.OutputStream out, boolean encodingWord)
      Creates a 'q' encoder.
      java.io.OutputStream outputQP​(java.io.OutputStream out)
      Creates a 'quoted-printable' encoder from the OutputStream.
      java.io.OutputStream outputUU​(java.io.OutputStream out, java.lang.String filename)
      Creates a 'uuencode', 'x-uuencode' and 'x-uue' encoder from the OutputStream.
      static StreamProvider provider()
      Creates a stream provider object.
    • Method Detail

      • inputBase64

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

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

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

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

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

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

        java.io.OutputStream outputQ​(java.io.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​(java.io.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​(java.io.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

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

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

        java.io.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

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

        java.io.OutputStream outputUU​(java.io.OutputStream out,
                                      java.lang.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