/** Read a polygon array. * @param planetModel is the planet model. * @param inputStream is the input stream. * @return the array of polygons that was read. */ static GeoPolygon[] readPolygonArray(final PlanetModel planetModel, final InputStream inputStream) throws IOException { return readHeterogeneousArray(planetModel, inputStream, GeoPolygon.class); }
/** * Constructor for deserialization. * @param planetModel is the planet model. * @param inputStream is the input stream. * @param clazz is the class of the generic. */ public GeoBaseCompositeShape(final PlanetModel planetModel, final InputStream inputStream, final Class<T> clazz) throws IOException { this(planetModel); final T[] array = SerializableObject.readHeterogeneousArray(planetModel, inputStream, clazz); for (final SerializableObject member : array) { addShape(clazz.cast(member)); } }