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
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 InputStream
inputBase64(InputStream in)
Creates a 'base64' decoder from the InputStream.InputStream
inputBinary(InputStream in)
Creates a 'binary', '7bit' and '8bit' decoder from the InputStream.LineInputStream
inputLineStream(InputStream in, boolean allowutf8)
Creates a new LineInputStream that supports reading CRLF terminated lines containing only US-ASCII characters from an input streamInputStream
inputQ(InputStream in)
Creates a 'q' decoder from the InputStream.InputStream
inputQP(InputStream in)
Creates a 'quoted-printable' decoder from the InputStream.InputStream
inputSharedByteArray(byte[] buff)
Creates a new InputStream from the underlying byte array to be shared between multiple readers.InputStream
inputUU(InputStream in)
Creates a 'uuencode', 'x-uuencode' and 'x-uue' decoder from the InputStream.OutputStream
outputB(OutputStream out)
Creates a 'b' encoder from the OutputStream.OutputStream
outputBase64(OutputStream out)
Creates a 'base64' encoder from the OutputStream.OutputStream
outputBinary(OutputStream out)
Creates a 'binary', '7bit' and '8bit' encoder from the OutputStream.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.OutputStream
outputQ(OutputStream out, boolean encodingWord)
Creates a 'q' encoder.OutputStream
outputQP(OutputStream out)
Creates a 'quoted-printable' encoder from the OutputStream.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 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 OutputStreamencodingWord
- 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 InputStreamallowutf8
- 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 OutputStreamallowutf8
- 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 OutputStreamfilename
- 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 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
-
-