Package jakarta.mail.util
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
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
Enumeration with the different encoder types supported by the Mail API. -
Method Summary
Modifier and TypeMethodDescriptionCreates a 'base64' decoder from the InputStream.Creates a 'binary', '7bit' and '8bit' decoder from the InputStream.inputLineStream
(InputStream in, boolean allowutf8) Creates a new LineInputStream that supports reading CRLF terminated lines containing only US-ASCII characters from an input streaminputQ
(InputStream in) Creates a 'q' decoder from the InputStream.inputQP
(InputStream in) Creates a 'quoted-printable' decoder from the InputStream.inputSharedByteArray
(byte[] buff) Creates a new InputStream from the underlying byte array to be shared between multiple readers.inputUU
(InputStream in) Creates a 'uuencode', 'x-uuencode' and 'x-uue' decoder from the InputStream.outputB
(OutputStream out) Creates a 'b' encoder from the OutputStream.outputBase64
(OutputStream out) Creates a 'base64' encoder from the OutputStream.outputBinary
(OutputStream out) Creates a 'binary', '7bit' and '8bit' encoder from the OutputStream.outputLineStream
(OutputStream out, boolean allowutf8) Creates a new LineOutputStream that supports writing out Strings as a sequence of bytes terminated by a CRLF sequence.outputQ
(OutputStream out, boolean encodingWord) Creates a 'q' encoder.outputQP
(OutputStream out) Creates a 'quoted-printable' encoder from the OutputStream.outputUU
(OutputStream out, String filename) Creates a 'uuencode', 'x-uuencode' and 'x-uue' encoder from the OutputStream.static StreamProvider
provider()
Creates a stream provider object.
-
Method Details
-
inputBase64
Creates a 'base64' decoder from the InputStream.- Parameters:
in
- the InputStream- Returns:
- the decoder
-
outputBase64
Creates a 'base64' encoder from the OutputStream.- Parameters:
out
- the OutputStream- Returns:
- the encoder
-
inputBinary
Creates a 'binary', '7bit' and '8bit' decoder from the InputStream.- Parameters:
in
- the InputStream- Returns:
- the decoder
-
outputBinary
Creates a 'binary', '7bit' and '8bit' encoder from the OutputStream.- Parameters:
out
- the OutputStream- Returns:
- the encoder
-
outputB
Creates a 'b' encoder from the OutputStream.- Parameters:
out
- the OutputStream- Returns:
- the encoder
-
inputQ
Creates a 'q' decoder from the InputStream.- Parameters:
in
- the InputStream- Returns:
- the decoder
-
outputQ
Creates a 'q' encoder.- Parameters:
out
- the OutputStreamencodingWord
- true if we are Q-encoding a word within a phrase.- Returns:
- the encoder
-
inputLineStream
Creates a new LineInputStream that supports reading CRLF terminated lines containing only US-ASCII characters from an input stream- Parameters:
in
- the InputStreamallowutf8
- allow UTF-8 characters?- Returns:
- the LineInputStream
-
outputLineStream
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 OutputStreamallowutf8
- allow UTF-8 characters?- Returns:
- the LineOutputStream
-
inputQP
Creates a 'quoted-printable' decoder from the InputStream.- Parameters:
in
- the InputStream- Returns:
- the decoder
-
outputQP
Creates a 'quoted-printable' encoder from the OutputStream.- Parameters:
out
- the OutputStream- Returns:
- the encoder
-
inputUU
Creates a 'uuencode', 'x-uuencode' and 'x-uue' decoder from the InputStream.- Parameters:
in
- the InputStream- Returns:
- the decoder
-
outputUU
Creates a 'uuencode', 'x-uuencode' and 'x-uue' encoder from the OutputStream.- Parameters:
out
- the OutputStreamfilename
- Specifies a name for the encoded buffer. It can be null.- Returns:
- the encoder
-
provider
Creates a stream provider object. The provider is loaded using theServiceLoader.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
-