Class 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 Detail

      • QEncoderStream

        public QEncoderStream​(OutputStream out,
                              boolean encodingWord)
        Create a Q encoder that encodes the specified input stream
        out - the output stream
        encodingWord - true if we are Q-encoding a word within a phrase.
    • Method Detail

      • write

        public void write​(int c)
                   throws IOException
        Encodes the specified byte to this output stream.
        write in class QPEncoderStream
        c - the byte.
        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.
        b - the byte array
        encodingWord - true if encoding words, false if encoding text
        the length