# HG changeset patch # User Artem Tikhomirov # Date 1300825120 -3600 # Node ID dd525ca65de8e78cb133919de57ea0a6e6454664 # Parent 86f9581f43011266dfe76cba42c73985856d1cef Stupid defect that cost me couple of hours. What a coincidence for merge revision of interest (157) to be right on the BIS buffer boundary. diff -r 86f9581f4301 -r dd525ca65de8 src/org/tmatesoft/hg/internal/RevlogDump.java --- a/src/org/tmatesoft/hg/internal/RevlogDump.java Tue Mar 22 03:52:34 2011 +0100 +++ b/src/org/tmatesoft/hg/internal/RevlogDump.java Tue Mar 22 21:18:40 2011 +0100 @@ -73,7 +73,10 @@ int parent2Revision = di.readInt(); byte[] buf = new byte[32]; di.readFully(buf, 12, 20); - dis.skip(12); + dis.skipBytes(12); + // CAN'T USE skip() here without extra precautions. E.g. I ran into situation when + // buffer was 8192 and BufferedInputStream was at position 8182 before attempt to skip(12). + // BIS silently skips available bytes and leaves me two extra bytes that ruin the rest of the code. System.out.printf("%4d:%14d %6X %10d %10d %10d %10d %8d %8d %040x\n", entryCount, offset, flags, compressedLen, actualLen, baseRevision, linkRevision, parent1Revision, parent2Revision, new BigInteger(buf)); if (inlineData) { String resultString;