Class QuotedPrintableDecoder
java.lang.Object
org.apache.commons.fileupload2.core.QuotedPrintableDecoder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intThe shift value required to create the upper nibble from the first of 2 byte values converted from ASCII hex. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateHidden constructor, this class must not be instantiated. -
Method Summary
Modifier and TypeMethodDescriptionstatic intdecode(byte[] data, OutputStream out) Decodes the encoded byte data writing it to the given output stream.private static inthexToBinary(byte b) Converts a hexadecimal digit to the binary value it represents.
-
Field Details
-
UPPER_NIBBLE_SHIFT
private static final int UPPER_NIBBLE_SHIFTThe 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
Decodes 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
Converts a hexadecimal digit to the binary value it represents.- Parameters:
b- the ASCII hexadecimal byte to convert (0-0, A-F, a-f)- Returns:
- the int value of the hexadecimal byte, 0-15
- Throws:
IOException- if the byte is not a valid hexadecimal digit.
-