Merge branch 'master' of ssh://gsa1.broadinstitute.org/humgen/gsa-scr1/gsa-engineering/git/unstable

This commit is contained in:
Eric Banks 2012-02-02 09:58:22 -05:00
commit d1a1888d2f
1 changed files with 10 additions and 1 deletions

View File

@ -443,7 +443,16 @@ public class BlockInputStream extends SeekableStream implements BAMInputStream {
// }
// }
return eof() ? -1 : length-remaining;
// If any data was copied into the buffer, return the amount of data copied.
if(remaining < length)
return length - remaining;
// Otherwise, if at eof(), return -1.
else if(eof())
return -1;
// Otherwise, we must've hit a bug in the system.
throw new ReviewedStingException("BUG: read returned no data, but eof() reports false.");
}
public void close() {