diff --git a/core/src/main/java/org/rnorth/tcpunixsocketproxy/NamedPipeSocket.java b/core/src/main/java/org/rnorth/tcpunixsocketproxy/NamedPipeSocket.java index 12b6ba78e88..1c9866c97d8 100644 --- a/core/src/main/java/org/rnorth/tcpunixsocketproxy/NamedPipeSocket.java +++ b/core/src/main/java/org/rnorth/tcpunixsocketproxy/NamedPipeSocket.java @@ -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 @@ -112,7 +114,10 @@ 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; } }; @@ -120,6 +125,8 @@ public int read(byte[] bytes) throws IOException { @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