package com.tutego.insel.io.ser;

import java.io.*;

class SerMe implements Serializable
{
  int i;
  double d;
  static final long serialVersionUID = 9027745268614067035L;
}

public class InvalidSer
{
  public static void main( String[] args ) throws Exception
  {
    String filename = "c:/test.ser";
    
    // Teil 1: Schreiben
    
    //    ObjectOutputStream oo = new ObjectOutputStream(
    //      new FileOutputStream( filename ) );
    //    oo.writeObject( new SerMe() );
    //    oo.close();
    
    // Teil 2: Klasse SerMe ändern und Lesen versuchen
    
    ObjectInputStream oi = new ObjectInputStream(
      new FileInputStream( filename ) );

    SerMe o = (SerMe) oi.readObject();
    System.out.println( o );
    oi.close();
  }
}
