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(); }