Permalink
Browse files

Fix a bug in the RewindableInputStream

  • Loading branch information...
1 parent 72aedc0 commit 4f4b2f428afba535fcc271b08e8fd3b9140a2580 @carllerche carllerche committed Mar 9, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/com/strobecorp/kirk/RewindableInputStream.java
@@ -292,7 +292,7 @@ private long fillBufFromTmpFile(long length) throws IOException {
}
}
- buf.clear().limit((int) length);
+ buf.clear().limit(Math.min((int) length, buf.capacity()));
if ( buffered > position ) {
tmpFile.position(position);

0 comments on commit 4f4b2f4

Please sign in to comment.