Code example for ObjectOutputStream

Methods: reset, writeObject

0
        } 
      }; 
    } 
 
    public void serialize(Serializable object) throws IOException {
      oos.reset(); // clear (class) back-references
      oos.writeObject(object);
    } 
 
    public void close() throws IOException { 
      oos.close();
    } 
 
  } 
 
  public boolean accept(Class<?> c) {
    return Serializable.class.isAssignableFrom(c);
  } 
 
  public Deserializer<Serializable> getDeserializer(Class<Serializable> c) {
    return new JavaSerializationDeserializer<Serializable>();