commit | dbb8fc3af839dff3e46bf2765d358b61f64ec0f7 | [log] [tgz] |
---|---|---|
author | Sebastian Bazley <sebb@apache.org> | Mon Mar 18 09:25:29 2013 +0000 |
committer | Sebastian Bazley <sebb@apache.org> | Mon Mar 18 09:25:29 2013 +0000 |
tree | 50e37e561fd6a39995fdb8663fcf0c9e249eba49 | |
parent | 75a88c2f732f7d596dc8d6707adcea7395aa90f3 [diff] |
Document and rename the magic constant git-svn-id: https://svn.apache.org/repos/asf/commons/proper/fileupload/trunk@1457681 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java b/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java index ea76100..554aaad 100644 --- a/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java +++ b/src/main/java/org/apache/commons/fileupload/util/mime/QuotedPrintableDecoder.java
@@ -33,9 +33,10 @@ }; /** - * The default number of byte shift for decode. + * The shift value required to create the upper nibble + * from the first of 2 byte values converted from ascii hex. */ - private static final int OUT_SHIFT = 4; + private static final int UPPER_NIBBLE_SHIFT = Byte.SIZE / 2; /** * The decoding table size. @@ -103,7 +104,7 @@ // this is a hex pair we need to convert back to a single byte. byte c1 = DECODING_TABLE[b1]; byte c2 = DECODING_TABLE[b2]; - out.write((c1 << OUT_SHIFT) | c2); + out.write((c1 << UPPER_NIBBLE_SHIFT) | c2); // 3 bytes in, one byte out bytesWritten++; }