Mercurial > hg4j
comparison src/org/tmatesoft/hg/internal/ByteArrayDataAccess.java @ 663:46b56864b483
Pull: phase2 - update phases from remote, fncache with added files. Tests
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 10 Jul 2013 16:41:49 +0200 |
parents | 55b7987c1796 |
children | 545b1d4cc11d |
comparison
equal
deleted
inserted
replaced
662:af5223b86dd3 | 663:46b56864b483 |
---|---|
50 return data[offset + pos++]; | 50 return data[offset + pos++]; |
51 } | 51 } |
52 @Override | 52 @Override |
53 public void readBytes(byte[] buf, int off, int len) throws IOException { | 53 public void readBytes(byte[] buf, int off, int len) throws IOException { |
54 if (len > (this.length - pos)) { | 54 if (len > (this.length - pos)) { |
55 throw new IOException(); | 55 throw new IOException(String.format("Requested %d bytes at position %d of %d total", len, pos, length)); |
56 } | 56 } |
57 System.arraycopy(data, offset+pos, buf, off, len); | 57 System.arraycopy(data, offset+pos, buf, off, len); |
58 pos += len; | 58 pos += len; |
59 } | 59 } |
60 @Override | 60 @Override |