"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient/src/main/java/org/apache/http/conn/EofSensorInputStream.java" between
httpcomponents-client-4.5.6-src.tar.gz and httpcomponents-client-4.5.7-src.tar.gz

About: HttpComponents is an Apache project responsible for creating and maintaining a toolset of low level Java components focused on HTTP and associated protocols. Java sources.

EofSensorInputStream.java  (httpcomponents-client-4.5.6-src):EofSensorInputStream.java  (httpcomponents-client-4.5.7-src)
skipping to change at line 114 skipping to change at line 114
*/ */
protected boolean isReadAllowed() throws IOException { protected boolean isReadAllowed() throws IOException {
if (selfClosed) { if (selfClosed) {
throw new IOException("Attempted read on closed stream."); throw new IOException("Attempted read on closed stream.");
} }
return (wrappedStream != null); return (wrappedStream != null);
} }
@Override @Override
public int read() throws IOException { public int read() throws IOException {
int l = -1; int readLen = -1;
if (isReadAllowed()) { if (isReadAllowed()) {
try { try {
l = wrappedStream.read(); readLen = wrappedStream.read();
checkEOF(l); checkEOF(readLen);
} catch (final IOException ex) { } catch (final IOException ex) {
checkAbort(); checkAbort();
throw ex; throw ex;
} }
} }
return l; return readLen;
} }
@Override @Override
public int read(final byte[] b, final int off, final int len) throws IOExcep tion { public int read(final byte[] b, final int off, final int len) throws IOExcep tion {
int l = -1; int readLen = -1;
if (isReadAllowed()) { if (isReadAllowed()) {
try { try {
l = wrappedStream.read(b, off, len); readLen = wrappedStream.read(b, off, len);
checkEOF(l); checkEOF(readLen);
} catch (final IOException ex) { } catch (final IOException ex) {
checkAbort(); checkAbort();
throw ex; throw ex;
} }
} }
return l; return readLen;
} }
@Override @Override
public int read(final byte[] b) throws IOException { public int read(final byte[] b) throws IOException {
return read(b, 0, b.length); return read(b, 0, b.length);
} }
@Override @Override
public int available() throws IOException { public int available() throws IOException {
int a = 0; // not -1 int a = 0; // not -1
 End of changes. 6 change blocks. 
8 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)