Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bsideup committed Feb 22, 2017
1 parent fe53d07 commit 40d239a
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ public void connect(SocketAddress endpoint, int timeout) throws IOException {
is = new InputStream() {
@Override
public int read(byte[] bytes, int off, int len) throws IOException {
return file.read(bytes, off, len);
int read = file.read(bytes, off, len);
System.out.println("Received " + read + " bytes with body: " + new String(bytes, off, len));
return read;
}

@Override
Expand All @@ -112,14 +114,19 @@ public int read() throws IOException {

@Override
public int read(byte[] bytes) throws IOException {
return file.read(bytes);
int read = file.read(bytes);

System.out.println("Received " + read + " bytes with body: " + new String(bytes, 0, read));
return read;
}
};

os = new OutputStream() {
@Override
public void write(byte[] bytes, int off, int len) throws IOException {
file.write(bytes, off, len);

System.out.println("Wrote bytes with body: " + new String(bytes, off, len));
}

@Override
Expand Down

0 comments on commit 40d239a

Please sign in to comment.