ASF Bugzilla – Attachment 8943 Details for
Bug 24398
Offset problem in hexadecimal dumps
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Improved dump() with respect to offset
longDump.patch (text/plain), 1.83 KB, created by
Jean-Pierre Paris
on 2003-11-05 07:15:53 UTC
(
hide
)
Description:
Improved dump() with respect to offset
Filename:
MIME Type:
Creator:
Jean-Pierre Paris
Created:
2003-11-05 07:15:53 UTC
Size:
1.83 KB
patch
obsolete
>Index: HexDump.java >=================================================================== >RCS file: /home/cvspublic/jakarta-poi/src/java/org/apache/poi/util/HexDump.java,v >retrieving revision 1.11 >diff -u -r1.11 HexDump.java >--- HexDump.java 30 Aug 2003 09:05:19 -0000 1.11 >+++ HexDump.java 5 Nov 2003 07:14:32 -0000 >@@ -64,6 +64,7 @@ > * > * @author Marc Johnson > * @author Glen Stampoultzis (glens at apache.org) >+ * @author Jean-Pierre Paris (jpparis at waidan dot com) > */ > > public class HexDump >@@ -134,7 +135,7 @@ > chars_read = 16; > } > buffer.append( >- dump(display_offset) >+ dump((int)display_offset) > ).append(' '); > for (int k = 0; k < 16; k++) > { >@@ -260,9 +261,20 @@ > { > StringBuffer buf = new StringBuffer(); > buf.setLength(0); >- for (int j = 0; j < 8; j++) >+ for (int j = 0; j < 16; j++) > { >- buf.append( _hexcodes[ (( int ) (value >> _shifts[ j ])) & 15 ]); >+ buf.append(_hexcodes[ (( int ) (value >> _shifts[ j ])) & 15 ]); >+ } >+ return buf.toString(); >+ } >+ >+ private static String dump(final int value) >+ { >+ StringBuffer buf = new StringBuffer(); >+ buf.setLength(0); >+ for (int j = 8; j < 16; j++) >+ { >+ buf.append(_hexcodes[ (( int ) (value >> _shifts[ j ])) & 15 ]); > } > return buf.toString(); > } >@@ -271,9 +283,9 @@ > { > StringBuffer buf = new StringBuffer(); > buf.setLength(0); >- for (int j = 0; j < 2; j++) >+ for (int j = 14; j < 16; j++) > { >- buf.append(_hexcodes[ (value >> _shifts[ j + 6 ]) & 15 ]); >+ buf.append(_hexcodes[ (value >> _shifts[ j ]) & 15 ]); > } > return buf.toString(); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 24398
:
8921
| 8943