Mercurial > jhg
diff src/org/tmatesoft/hg/internal/DataAccessProvider.java @ 157:d5268ca7715b
Merged branch wrap-data-access into default for resource-friendly data access. Updated API to promote that friendliness to clients (channels, not byte[]). More exceptions
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 09 Mar 2011 05:22:17 +0100 |
parents | src/com/tmate/hgkit/fs/DataAccessProvider.java@9429c7bd1920 src/com/tmate/hgkit/fs/DataAccessProvider.java@a3a2e5deb320 |
children | b413b16d10a5 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/DataAccessProvider.java Wed Mar 02 01:06:09 2011 +0100 +++ b/src/org/tmatesoft/hg/internal/DataAccessProvider.java Wed Mar 09 05:22:17 2011 +0100 @@ -86,6 +86,17 @@ } @Override + public long length() { + return size; + } + + @Override + public DataAccess reset() throws IOException { + seek(0); + return this; + } + + @Override public void seek(long offset) { assert offset >= 0; // offset may not necessarily be further than current position in the file (e.g. rewind) @@ -188,6 +199,17 @@ } @Override + public long length() { + return size; + } + + @Override + public DataAccess reset() throws IOException { + seek(0); + return this; + } + + @Override public void seek(long offset) throws IOException { if (offset > size) { throw new IllegalArgumentException();