Class QuotedPrintableDecoder


  • final class QuotedPrintableDecoder
    extends java.lang.Object
    Since:
    1.3
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static int UPPER_NIBBLE_SHIFT
      The shift value required to create the upper nibble from the first of 2 byte values converted from ascii hex.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private QuotedPrintableDecoder()
      Hidden constructor, this class must not be instantiated.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int decode​(byte[] data, java.io.OutputStream out)
      Decode the encoded byte data writing it to the given output stream.
      private static int hexToBinary​(byte b)
      Convert a hex digit to the binary value it represents.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • UPPER_NIBBLE_SHIFT

        private static final int UPPER_NIBBLE_SHIFT
        The shift value required to create the upper nibble from the first of 2 byte values converted from ascii hex.
        See Also:
        Constant Field Values
    • Constructor Detail

      • QuotedPrintableDecoder

        private QuotedPrintableDecoder()
        Hidden constructor, this class must not be instantiated.
    • Method Detail

      • decode

        public static int decode​(byte[] data,
                                 java.io.OutputStream out)
                          throws java.io.IOException
        Decode the encoded byte data writing it to the given output stream.
        Parameters:
        data - The array of byte data to decode.
        out - The output stream used to return the decoded data.
        Returns:
        the number of bytes produced.
        Throws:
        java.io.IOException
      • hexToBinary

        private static int hexToBinary​(byte b)
                                throws java.io.IOException
        Convert a hex digit to the binary value it represents.
        Parameters:
        b - the ascii hex byte to convert (0-0, A-F, a-f)
        Returns:
        the int value of the hex byte, 0-15
        Throws:
        java.io.IOException - if the byte is not a valid hex digit.