protected ProtocolMessage readMessage() throws IOException, ReplicatorException {
  if (ois == null) {
    ois=new ObjectInputStream(new BufferedInputStream(socket.getInputStream()));
  }
  Object obj;
  try {
    obj=ois.readObject();
  }
 catch (  ClassNotFoundException e) {
    throw new THLException(e.getMessage());
  }
  if (obj instanceof ProtocolMessage == false)   throw new THLException("Invalid object in stream");
  return (ProtocolMessage)obj;
}

protected ProtocolMessage readMessage ( ) throws IOException , ReplicatorException { if ( ois == null ) { ois = new ObjectInputStream ( new BufferedInputStream ( socket . getInputStream ( ) ) ) ; } Object obj ; try { obj = ois . readObject ( ) ; } catch ( ClassNotFoundException e ) { throw new THLException ( e . getMessage ( ) ) ; } if ( obj instanceof ProtocolMessage == false ) throw new THLException ( "Invalid object in stream" ) ; return ( ProtocolMessage ) obj ; }
read a message from network from either side .
