(String[] args)
| 9 | |
| 10 | public 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] |
nothing calls this directly
no test coverage detected