Package com.sun.mail.util
Class QEncoderStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- com.sun.mail.util.QPEncoderStream
-
- com.sun.mail.util.QEncoderStream
-
- All Implemented Interfaces:
Closeable
,Flushable
,AutoCloseable
public class QEncoderStream extends QPEncoderStream
This class implements a Q Encoder as defined by RFC 2047 for encoding MIME headers. It subclasses the QPEncoderStream class.
-
-
Constructor Summary
Constructors Constructor Description QEncoderStream(OutputStream out, boolean encodingWord)
Create a Q encoder that encodes the specified input stream
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static int
encodedLength(byte[] b, boolean encodingWord)
Returns the length of the encoded version of this byte array.void
write(int c)
Encodes the specifiedbyte
to this output stream.-
Methods inherited from class com.sun.mail.util.QPEncoderStream
close, flush, write, write
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
-
-
-
Constructor Detail
-
QEncoderStream
public QEncoderStream(OutputStream out, boolean encodingWord)
Create a Q encoder that encodes the specified input stream- Parameters:
out
- the output streamencodingWord
- true if we are Q-encoding a word within a phrase.
-
-
Method Detail
-
write
public void write(int c) throws IOException
Encodes the specifiedbyte
to this output stream.- Overrides:
write
in classQPEncoderStream
- Parameters:
c
- thebyte
.- Throws:
IOException
- if an I/O error occurs.
-
encodedLength
public static int encodedLength(byte[] b, boolean encodingWord)
Returns the length of the encoded version of this byte array.- Parameters:
b
- the byte arrayencodingWord
- true if encoding words, false if encoding text- Returns:
- the length
-
-