Class QuotedPrintableDecoder

java.lang.Object
org.apache.commons.fileupload.util.mime.QuotedPrintableDecoder

final class QuotedPrintableDecoder extends Object
Since:
1.3
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final char
    Carriage return character ''\r''.
    private static final char
    Equal character ''=''.
    private static final char
    Line feed character ''\n''.
    private static final char
    Space character '' ''.
    private static final char
    Underscore character ''_''.
    private static final int
    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
    Hidden constructor, this class must not be instantiated.
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    decode(byte[] data, 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 Details

    • CR

      private static final char CR
      Carriage return character ''\r''.
      See Also:
    • EQUAL

      private static final char EQUAL
      Equal character ''=''.
      See Also:
    • LF

      private static final char LF
      Line feed character ''\n''.
      See Also:
    • SP

      private static final char SP
      Space character '' ''.
      See Also:
    • UNDERSCORE

      private static final char UNDERSCORE
      Underscore character ''_''.
      See Also:
    • 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:
  • Constructor Details

    • QuotedPrintableDecoder

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

    • decode

      public static int decode(byte[] data, OutputStream out) throws 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:
      IOException - if an IO error occurs
    • hexToBinary

      private static int hexToBinary(byte b) throws 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:
      IOException - if the byte is not a valid hex digit.