Mercurial > jhg
diff src/org/tmatesoft/hg/internal/DataAccess.java @ 420:6c22bdc0bdfd
Respect long offsets in revlogs
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 22 Mar 2012 22:56:01 +0100 |
parents | 528b6780a8bd |
children | fdd7d756dea0 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/DataAccess.java Thu Mar 22 21:36:41 2012 +0100 +++ b/src/org/tmatesoft/hg/internal/DataAccess.java Thu Mar 22 22:56:01 2012 +0100 @@ -33,9 +33,22 @@ return true; } // TODO throws IOException (few subclasses have non-trivial length() operation) + // long length and offset are needed only in RevlogStream, makes no sense elsewhere + // because chunks Mercurial operates with fit into int (4 bytes actualLength field) + // For those that may face large pieces of data (actual data streams) there are #longLength + // and #longSeek() to implement public int length() { return 0; } + + public long longLength() { + return length(); + } + + public void longSeek(long offset) throws IOException { + seek(Internals.ltoi(offset)); + } + /** * get this instance into initial state * @throws IOException