Bug 24398 - Offset problem in hexadecimal dumps
Summary: Offset problem in hexadecimal dumps
Status: RESOLVED WORKSFORME
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 2.0-dev
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-04 15:51 UTC by Jean-Pierre Paris
Modified: 2014-07-22 07:40 UTC (History)
0 users



Attachments
dump(long) method now return a correct value, not always 0 (1.07 KB, patch)
2003-11-04 15:53 UTC, Jean-Pierre Paris
Details | Diff
Improved dump() with respect to offset (1.83 KB, patch)
2003-11-05 07:15 UTC, Jean-Pierre Paris
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Pierre Paris 2003-11-04 15:51:39 UTC
Long values at start of lines of hexa dump are always 0
Comment 1 Jean-Pierre Paris 2003-11-04 15:53:12 UTC
Created attachment 8921 [details]
dump(long) method now return a correct value, not always 0
Comment 2 Jean-Pierre Paris 2003-11-04 15:55:27 UTC
I suspect that the method dump(byte) has the same problem, but my pacth dont 
correct it.
Moreover, I am sure that my patch should be rewritten to accept modifications 
in the _shifts variable.
Comment 3 Jean-Pierre Paris 2003-11-05 07:15:53 UTC
Created attachment 8943 [details]
Improved dump() with respect to offset
Comment 4 Jean-Pierre Paris 2003-11-05 07:20:37 UTC
The second path (11/05/03 07:15) adds a method to dump int values. Offset is 
casted to int so that the dump printout stays the same.
I also corrected dump(long) and dump(byte).

I think there is a problem with the offset argument take as long in 
    public synchronized static void dump(final byte [] data, final long offset,
                            final OutputStream stream, final int index, final 
int length)
because arrays can be indirected by long values as far as I know.
Comment 5 Dominik Stadler 2014-07-22 07:40:44 UTC
I am not sure what the actual problem was here and I could not find anything in the lines that HexDump prints nowadays, so I think this is long fixed via other commits, please reopen with some more info if this is still an issue for you.