Commit 2a06c264 by Tanuj Mittal

Fix DataSourceInputStream.read() for EOF cases

parent 7f58a0be
...@@ -58,9 +58,12 @@ public class DataSourceInputStream extends InputStream { ...@@ -58,9 +58,12 @@ public class DataSourceInputStream extends InputStream {
@Override @Override
public int read() throws IOException { public int read() throws IOException {
read(singleByteArray); int length = read(singleByteArray);
if(length != -1) {
return singleByteArray[0] & 0xFF; return singleByteArray[0] & 0xFF;
} }
return length;
}
@Override @Override
public int read(byte[] buffer) throws IOException { public int read(byte[] buffer) throws IOException {
......
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