Mercurial > hg4j
diff src/org/tmatesoft/hg/internal/DataAccess.java @ 158:b413b16d10a5
Integer offsets and file length explictly, rather than casts throughout code. Inflater may benefit from total length hint, but shall calculate it by its own if needed
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 09 Mar 2011 13:16:37 +0100 |
parents | d5268ca7715b |
children | 5e95b0da26f2 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/DataAccess.java Wed Mar 09 05:22:17 2011 +0100 +++ b/src/org/tmatesoft/hg/internal/DataAccess.java Wed Mar 09 13:16:37 2011 +0100 @@ -32,7 +32,7 @@ public boolean isEmpty() { return true; } - public long length() { + public int length() { return 0; } /** @@ -45,7 +45,7 @@ return this; } // absolute positioning - public void seek(long offset) throws IOException { + public void seek(int offset) throws IOException { throw new UnsupportedOperationException(); } // relative positioning @@ -95,7 +95,7 @@ // FIXME exception handling is not right, just for the sake of quick test public byte[] byteArray() throws IOException { reset(); - byte[] rv = new byte[(int) length()]; + byte[] rv = new byte[length()]; readBytes(rv, 0, rv.length); return rv; }