Fix DataSourceInputStream.read() for EOF cases

This commit is contained in:
Tanuj Mittal 2015-05-05 16:30:09 +05:30
parent 7f58a0be81
commit 2a06c2641c

View File

@ -58,8 +58,11 @@ public class DataSourceInputStream extends InputStream {
@Override @Override
public int read() throws IOException { public int read() throws IOException {
read(singleByteArray); int length = read(singleByteArray);
return singleByteArray[0] & 0xFF; if(length != -1) {
return singleByteArray[0] & 0xFF;
}
return length;
} }
@Override @Override