|
@ -1,9 +1,9 @@ |
|
|
package com.jesuspinar.miobjeto.serializable; |
|
|
|
|
|
|
|
|
package com.jesuspinar.miobjeto; |
|
|
|
|
|
|
|
|
import com.jesuspinar.miobjeto.serializable.controller.ObjReader; |
|
|
|
|
|
import com.jesuspinar.miobjeto.serializable.controller.ObjWriter; |
|
|
|
|
|
import com.jesuspinar.miobjeto.serializable.model.Person; |
|
|
|
|
|
import com.jesuspinar.miobjeto.serializable.model.People; |
|
|
|
|
|
|
|
|
import com.jesuspinar.miobjeto.controller.ObjReader; |
|
|
|
|
|
import com.jesuspinar.miobjeto.controller.ObjWriter; |
|
|
|
|
|
import com.jesuspinar.miobjeto.model.Person; |
|
|
|
|
|
import com.jesuspinar.miobjeto.model.People; |
|
|
|
|
|
|
|
|
import java.io.File; |
|
|
import java.io.File; |
|
|
|
|
|
|
|
@ -22,13 +22,12 @@ public class Main { |
|
|
boolean isWritten = ObjWriter.write(data,file); |
|
|
boolean isWritten = ObjWriter.write(data,file); |
|
|
|
|
|
|
|
|
//Test serialization |
|
|
//Test serialization |
|
|
People dat = null; |
|
|
|
|
|
|
|
|
People p = null; |
|
|
if (isWritten) { |
|
|
if (isWritten) { |
|
|
dat = (People) ObjReader.read(file); |
|
|
|
|
|
} |
|
|
|
|
|
if (dat != null){ |
|
|
|
|
|
System.out.println(dat.toString()); |
|
|
|
|
|
|
|
|
p = (People) ObjReader.read(file); |
|
|
|
|
|
System.out.println(p.toString()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |