Class QuotedPrintableDecoder
- java.lang.Object
-
- org.apache.commons.fileupload.util.mime.QuotedPrintableDecoder
-
final class QuotedPrintableDecoder extends java.lang.Object- Since:
- 1.3
-
-
Field Summary
Fields Modifier and Type Field Description private static charCRCarriage return character '13'.private static charEQUALEqual character '61'.private static charLFLine feed character '10'.private static charSPSpace character '32'.private static charUNDERSCOREUnderscore character '95'.private static intUPPER_NIBBLE_SHIFTThe 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 privateQuotedPrintableDecoder()Hidden constructor, this class must not be instantiated.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intdecode(byte[] data, java.io.OutputStream out)Decode the encoded byte data writing it to the given output stream.private static inthexToBinary(byte b)Convert a hex digit to the binary value it represents.
-
-
-
Field Detail
-
CR
private static final char CR
Carriage return character '13'.- See Also:
- Constant Field Values
-
EQUAL
private static final char EQUAL
Equal character '61'.- See Also:
- Constant Field Values
-
LF
private static final char LF
Line feed character '10'.- See Also:
- Constant Field Values
-
SP
private static final char SP
Space character '32'.- See Also:
- Constant Field Values
-
UNDERSCORE
private static final char UNDERSCORE
Underscore character '95'.- See Also:
- Constant Field Values
-
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
-
-
Method Detail
-
decode
public static int decode(byte[] data, java.io.OutputStream out) throws java.io.IOExceptionDecode 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- if an IO error occurs
-
hexToBinary
private static int hexToBinary(byte b) throws java.io.IOExceptionConvert 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.
-
-