int pos = 0;
    public EsriGraphicList getPolyGeometry(int[][] indexData, int shapeType)            throws Exception {        EsriGraphicList list = null;        if (shapeType == SHAPE_TYPE_POLYLINE) {            list = new EsriPolylineList();        } else if (shapeType == SHAPE_TYPE_POLYGON) {            list = new EsriPolygonList();        }        int numVertices;        int pos = 0;        int numShapes = indexData[1].length;        for (int t = 0; t < numShapes; t++) {            int shpRecord = _leis.readInt();            int shpContentLength = _leis.readInt();            int shpType = _leis.readLEInt();            double xLeft = _leis.readLEDouble();            double xBottom = _leis.readLEDouble();            double xRight = _leis.readLEDouble();            double xTop = _leis.readLEDouble();            int numParts = _leis.readLEInt();            int numPoints = _leis.readLEInt();            double[] ptsx = new double[numPoints];            double[] ptsy = new double[numPoints];            int[] offsets = new int[numParts];            // OK, we don't want to create a sublist unless the poly            // has multiple parts. Remember that. sublist will only            // be created if there is more than one part.            for (int n = 0; n < numParts; n++) {                offsets[n] = _leis.readLEInt();            }            float[] points;            OMGraphic poly = null;            EsriGraphicList sublist = null;            if (numParts > 1) {                if (shapeType == SHAPE_TYPE_POLYLINE) {                    sublist = new EsriPolylineList();                } else if (shapeType == SHAPE_TYPE_POLYGON) {                    sublist = new EsriPolygonList();                }                sublist.setVague(true); // Treat sublist as one                // OMGraphic.                sublist.setAppObject(new Integer(shpRecord));            }            for (int j = 0; j < numParts; j++) {                int i = 0;                if (j != numParts - 1) {                    numVertices = (offsets[j + 1]) - offsets[j];                    points = new float[numVertices * 2];                } else {                    numVertices = (numPoints - offsets[j]);                    points = new float[numVertices * 2];                }                for (int n = 0; n < numVertices; n++) {                    double lambda = _leis.readLEDouble();                    double phi = _leis.readLEDouble();                    Double d1 = new Double(phi);                    Double d2 = new Double(lambda);                    points[i++] = d1.floatValue();                    points[i++] = d2.floatValue();                }                if (shapeType == SHAPE_TYPE_POLYLINE) {                    poly = new EsriPolyline(points, OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_STRAIGHT);                } else if (shapeType == SHAPE_TYPE_POLYGON) {                    poly = new EsriPolygon(points, OMGraphic.DECIMAL_DEGREES, OMGraphic.LINETYPE_STRAIGHT);                }                poly.setAppObject(new Integer(shpRecord));                if (drawingAttributes != null) {                    drawingAttributes.setTo(poly);                } else {                    DrawingAttributes.DEFAULT.setTo(poly);                }                if (poly instanceof EsriPolyline) {                    // Just to make sure it gets rendered as a                    // polyline. The OMPoly code will render it as a                    // polygon if the fill color is not clear.                    poly.setFillPaint(OMColor.clear);                }                if (sublist != null) {                    sublist.addOMGraphic(poly);                }            }            // sublist is null for non multi-part geometries.            if (sublist != null) {                list.add(sublist);            } else {                list.add(poly);            }            if (Debug.debugging("esri")) {                EsriGraphic eg = null;                if (sublist == null) {                    eg = (EsriGraphic) poly;                } else {                    eg = sublist;                }                float[] ex1 = eg.getExtents();                Debug.output("extents of list: xmin=" + ex1[1] + ", ymin="                        + ex1[0] + ", xmax=" + ex1[3] + ", ymax=" + ex1[2]);                Debug.output("list.size=" + list.size());            }        }        if (Debug.debugging("esri")) {            float[] ex = list.getExtents();            Debug.output("extents of list: xmin=" + ex[1] + ", ymin=" + ex[0]                    + ", xmax=" + ex[3] + ", ymax=" + ex[2]);        }        return list;    }