Commit e54d07c1 by Oliver Woodman

Fix issue with new extractor input

parent 5e4a35fa
...@@ -82,15 +82,15 @@ public final class DataSourceExtractorInput implements ExtractorInput { ...@@ -82,15 +82,15 @@ public final class DataSourceExtractorInput implements ExtractorInput {
if (Thread.interrupted()) { if (Thread.interrupted()) {
throw new InterruptedException(); throw new InterruptedException();
} }
int bytesRead = dataSource.read(SCRATCH_SPACE, 0, remaining); int bytesRead = dataSource.read(SCRATCH_SPACE, 0, Math.min(SCRATCH_SPACE.length, remaining));
if (bytesRead == -1) { if (bytesRead == -1) {
isEnded = true; isEnded = true;
return true; return false;
} }
remaining -= bytesRead; remaining -= bytesRead;
} }
position += length; position += length;
return false; return true;
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment