Top Fields Constructors Methods
org.apache.tomcat.util.http.fileupload.util.mime

pack-priv final Class QuotedPrintableDecoder

extends Object
Class Inheritance
Imports
java.io.IOException, .OutputStream

Since
1.3

Field Summary

Modifier and TypeField and Description
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.

Constructor Summary

AccessConstructor and Description
private
QuotedPrintableDecoder()

Hidden constructor, this class must not be instantiated.

Method Summary

Modifier and TypeMethod and Description
public static int

Returns:

the number of bytes produced.
decode
(final byte[]
The array of byte data to decode.
data
,
final OutputStream
The output stream used to return the decoded data.
out
)

Decode the encoded byte data writing it to the given output stream.

private static int

Returns:

the int value of the hex byte, 0-15
hexToBinary
(final byte
the ascii hex byte to convert (0-0, A-F, a-f)
b
)

Convert a hex digit to the binary value it represents.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

UPPER_NIBBLE_SHIFTback to summary
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.

Constructor Detail

QuotedPrintableDecoderback to summary
private QuotedPrintableDecoder()

Hidden constructor, this class must not be instantiated.

Method Detail

decodeback to summary
public static int decode(final byte[] data, final OutputStream out) throws IOException

Decode the encoded byte data writing it to the given output stream.

Parameters
data:byte[]

The array of byte data to decode.

out:OutputStream

The output stream used to return the decoded data.

Returns:int

the number of bytes produced.

Exceptions
IOException:
if an IO error occurs
hexToBinaryback to summary
private static int hexToBinary(final byte b) throws IOException

Convert a hex digit to the binary value it represents.

Parameters
b:byte

the ascii hex byte to convert (0-0, A-F, a-f)

Returns:int

the int value of the hex byte, 0-15

Exceptions
IOException:
if the byte is not a valid hex digit.