Author: elecharny Date: Sat Sep 3 07:53:09 2011 New Revision: 1164817 URL: http://svn.apache.org/viewvc?rev=1164817&view=rev Log: Applied Selcuk's fix (use of readFully instead of read). DIRSERVER-1653 Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventMessageSerializer.java Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventMessageSerializer.java URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventMessageSerializer.java?rev=1164817&r1=1164816&r2=1164817&view=diff ============================================================================== --- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventMessageSerializer.java (original) +++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventMessageSerializer.java Sat Sep 3 07:53:09 2011 @@ -23,6 +23,7 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; +import java.io.ObjectOutput; import java.io.ObjectOutputStream; import jdbm.helper.Serializer; @@ -82,7 +83,7 @@ public class ReplicaEventMessageSerializ ChangeType changeType = replicaEventMessage.getChangeType(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream out = new ObjectOutputStream( baos ); + ObjectOutput out = new ObjectOutputStream( baos ); // The entry DN entry.getDn().writeExternal( out ); @@ -126,10 +127,12 @@ public class ReplicaEventMessageSerializ // The Entry's length int length = in.readInt(); + byte[] data = new byte[length]; // The entry itself - in.read( data ); + in.readFully( data ); + Entry entry = ( Entry ) entrySerializer.deserialize( data ); entry.setDn( entryDn );