MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

serialization/RecoverCADState.java:11–28  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

9
10public class RecoverCADState {
11 @SuppressWarnings("unchecked")
12 public static void main(String[] args) {
13 try(
14 ObjectInputStream in =
15 new ObjectInputStream(
16 new FileInputStream("CADState.dat"))
17 ) {
18 // Read in the same order they were written:
19 List<Class<? extends Shape>> shapeTypes =
20 (List<Class<? extends Shape>>)in.readObject();
21 Line.deserializeStaticState(in);
22 List<Shape> shapes =
23 (List<Shape>)in.readObject();
24 System.out.println(shapes);
25 } catch(IOException | ClassNotFoundException e) {
26 throw new RuntimeException(e);
27 }
28 }
29}
30/* Output:
31[class CircleColor[RED] xPos[58] yPos[55] dim[93]

Callers

nothing calls this directly

Calls 2

readObjectMethod · 0.80

Tested by

no test coverage detected