/** * Read the class from the stream * @param inputStream is the stream to read from. * @return is the class read */ static Class<?> readClass(final InputStream inputStream) throws IOException, ClassNotFoundException { boolean standard = readBoolean(inputStream); if (standard) { int index = inputStream.read(); return StandardObjects.codeRegsitry.get(index); } else { String className = readString(inputStream); return Class.forName(className); } }
/** * Constructor for deserialization. * @param planetModel is the planet model. * @param inputStream is the input stream. */ public GeoComplexPolygon(final PlanetModel planetModel, final InputStream inputStream) throws IOException { this(planetModel, readPointsList(planetModel, inputStream), new GeoPoint(planetModel, inputStream), SerializableObject.readBoolean(inputStream)); }