Code example for ObjectInputStream

Methods: readBoolean, readInt, readObject

0
     
    public static <E> DataModel<E> readDataModel(ObjectInputStream in) 
            throws IOException, ClassNotFoundException { 
         
        DataModel<E> result = null;
        if (in.readBoolean()) {
            result = new ListDataModel<E>();
            result.setWrappedData(in.readObject());
            result.setRowIndex(in.readInt());            
        }             
        return result;   
    } 
     
}