Code example for ObjectInput

Methods: readBooleanreadUTF

0
        } 
    } 
 
    public void readExternal(ObjectInput in) throws IOException,
                                            ClassNotFoundException { 
        if ( in.readBoolean() ) {
            msg = in.readUTF();
        } 
 
    } 
 
    public String getMessage() {
        return msg;
    } 
}