Merge pull request #429 from gitanuj/datasourceinputstream-fix

Fix DataSourceInputStream.read() for EOF cases
This commit is contained in:
ojw28 2015-05-05 13:51:03 +01:00
commit ab402bd13e

View file

@ -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 {