"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient/src/main/java-deprecated/org/apache/http/impl/conn/LoggingSessionInputBuffer.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.

LoggingSessionInputBuffer.java  (httpcomponents-client-4.5.6-src):LoggingSessionInputBuffer.java  (httpcomponents-client-4.5.7-src)
skipping to change at line 86 skipping to change at line 86
this(in, wire, null); this(in, wire, null);
} }
@Override @Override
public boolean isDataAvailable(final int timeout) throws IOException { public boolean isDataAvailable(final int timeout) throws IOException {
return this.in.isDataAvailable(timeout); return this.in.isDataAvailable(timeout);
} }
@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 {
final int l = this.in.read(b, off, len); final int readLen = this.in.read(b, off, len);
if (this.wire.enabled() && l > 0) { if (this.wire.enabled() && readLen > 0) {
this.wire.input(b, off, l); this.wire.input(b, off, readLen);
} }
return l; return readLen;
} }
@Override @Override
public int read() throws IOException { public int read() throws IOException {
final int l = this.in.read(); final int b = this.in.read();
if (this.wire.enabled() && l != -1) { if (this.wire.enabled() && b != -1) {
this.wire.input(l); this.wire.input(b);
} }
return l; return b;
} }
@Override @Override
public int read(final byte[] b) throws IOException { public int read(final byte[] b) throws IOException {
final int l = this.in.read(b); final int readLen = this.in.read(b);
if (this.wire.enabled() && l > 0) { if (this.wire.enabled() && readLen > 0) {
this.wire.input(b, 0, l); this.wire.input(b, 0, readLen);
} }
return l; return readLen;
} }
@Override @Override
public String readLine() throws IOException { public String readLine() throws IOException {
final String s = this.in.readLine(); final String s = this.in.readLine();
if (this.wire.enabled() && s != null) { if (this.wire.enabled() && s != null) {
final String tmp = s + "\r\n"; final String tmp = s + "\r\n";
this.wire.input(tmp.getBytes(this.charset)); this.wire.input(tmp.getBytes(this.charset));
} }
return s; return s;
} }
@Override @Override
public int readLine(final CharArrayBuffer buffer) throws IOException { public int readLine(final CharArrayBuffer buffer) throws IOException {
final int l = this.in.readLine(buffer); final int readLen = this.in.readLine(buffer);
if (this.wire.enabled() && l >= 0) { if (this.wire.enabled() && readLen >= 0) {
final int pos = buffer.length() - l; final int pos = buffer.length() - readLen;
final String s = new String(buffer.buffer(), pos, l); final String s = new String(buffer.buffer(), pos, readLen);
final String tmp = s + "\r\n"; final String tmp = s + "\r\n";
this.wire.input(tmp.getBytes(this.charset)); this.wire.input(tmp.getBytes(this.charset));
} }
return l; return readLen;
} }
@Override @Override
public HttpTransportMetrics getMetrics() { public HttpTransportMetrics getMetrics() {
return this.in.getMetrics(); return this.in.getMetrics();
} }
@Override @Override
public boolean isEof() { public boolean isEof() {
if (this.eofSensor != null) { if (this.eofSensor != null) {
 End of changes. 8 change blocks. 
17 lines changed or deleted 17 lines changed or added

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