title: Read geometries from ESRI shapefile 'one-by-one'
body: <p>I am trying to achieve simple goal. Using <a href="https://github.com/Esri/geometry-api-java" rel="nofollow">https://github.com/Esri/geometry-api-java</a> library I want to read <strong>multiple</strong> geometries from shapefile, but so far it seems that API doesn't provide ability to do so, by now I managed to impport single geometry from file (first one).</p>
  
  <p>Here are code samples that I tried in order to make it works:</p>
  
  <p>property in = FileInputStream</p>
  
  <pre><code>Geometry geometry = GeometryEngine.geometryFromEsriShape(IOUtils.toByteArray(in), Geometry.Type.Unknown);
  System.out.println(geometry);
  
  
  OperatorImportFromESRIShape importerShape = (OperatorImportFromESRIShape) OperatorFactoryLocal.getInstance().getOperator(Operator.Type.ImportFromESRIShape);
  ByteBuffer byteBuffer = ByteBuffer.wrap(IOUtils.toByteArray(in));
  Geometry geometry = importerShape.execute(0, Geometry.Type.Unknown, byteBuffer);
  </code></pre>
  
  <p>In both cases API returns only single Geometry.
  The question is how to read multiple geometries from input stream one by one.</p>
  
  <p>Thank you for any help.</p>