--- lib/jinterface-1.4.1/java_src/com/ericsson/otp/erlang/AbstractConnection.java.orig	Tue Sep 2 19:26:08 2008 UTC
+++ lib/jinterface-1.4.1/java_src/com/ericsson/otp/erlang/AbstractConnection.java	Fri Oct 10 13:37:38 2008 UTC
@@ -859,8 +859,9 @@
 
       if (i < 0) {
 	throw new IOException("expected " + len + " bytes, got EOF after " + got + " bytes");
-      }
-      else got += i;
+      } else if (i == 0) {
+         throw new IOException("Remote connection closed");
+      } else got += i;
     }
     return got;
   }
