public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
  String s=in.readUTF();
  if (s == null || s.length() == 0) {
    byte[] ba=new byte[in.readInt()];
    in.readFully(ba);
    s=new String(ba);
  }
  try {
    parse(s);
  }
 catch (  MimeTypeParseException e) {
    throw new IOException(e.toString());
  }
}

public void readExternal ( ObjectInput in ) throws IOException , ClassNotFoundException { String s = in . readUTF ( ) ; if ( s == null || s . length ( ) == 0 ) { byte [ ] ba = new byte [ in . readInt ( ) ] ; in . readFully ( ba ) ; s = new String ( ba ) ; } try { parse ( s ) ; } catch ( MimeTypeParseException e ) { throw new IOException ( e . toString ( ) ) ; } }
the object implements the readexternal method to restore its contents by calling the methods of datainput for primitive types and readobject for objects , strings and arrays . the readexternal method must read the values in the same sequence and with the same types as were written by writeexternal .
