int numShapes = list.size();
    public int[][] writePolyGeometry(EsriGraphicList list) throws IOException {        int numShapes = list.size();        OMPoly poly;        _leos.writeInt(9994); //Byte 0 File Code        _leos.writeInt(0); //Byte 4 Unused        _leos.writeInt(0); //Byte 8 Unused        _leos.writeInt(0); //Byte 12 Unused        _leos.writeInt(0); //Byte 16 Unused        _leos.writeInt(0); //Byte 20 Unused        int[][] indexData = createPolyIndex(list);        int contentLength = list.size();        contentLength *= 4; //Multiply each shape by 4 words        contentLength += 50; //Add 50 words for the header section.        _leos.writeInt(contentLength); //Byte 24 File Length        _leos.writeLEInt(1000); //Byte 28 Version        _leos.writeLEInt(list.getType()); //Byte 32 Shape Type        //Writes bounding box.        float[] extents = list.getExtents();        writeExtents(extents);        _leos.writeDouble(0.0); //Byte 68        _leos.writeDouble(0.0); //Byte 76        _leos.writeDouble(0.0); //Byte 84        _leos.writeDouble(0.0); //Byte 92        //Iterate through the list        for (int i = 0; i < list.size(); i++) {            OMGraphic graphic = list.getOMGraphicAt(i);            //Record header            _leos.writeInt(i + 1); // Record numbers start with 1            _leos.writeInt(indexData[1][i]);            //Beginning of Geometry data            _leos.writeLEInt(list.getType()); //Little endian            // More stuff needs to be written out for just the OMPoly            // case...            // Single part, etc.            if (graphic instanceof EsriGraphicList) {                // Assumes that the elements of the top level list are                // EsriGraphicLists, too. This will probably be                // changing.                EsriGraphicList sublist = (EsriGraphicList) graphic;                //Writes bounding box.                extents = sublist.getExtents();                writeExtents(extents);                //Writes number of parts                int numParts = sublist.size();                _leos.writeLEInt(numParts);                //Write number of points per shape                int numPoints = getPointsPerShape(sublist);                _leos.writeLEInt(numPoints);                //Write the offsets to each part for a given shape                int[] offsets = getPartOffsets(sublist);                for (int j = 0; j < offsets.length; j++) {                    _leos.writeLEInt(offsets[j]);                }                //Write the geometry for each part                for (int j = 0; j < sublist.size(); j++) {                    poly = (OMPoly) sublist.getOMGraphicAt(j);                    float[] data = poly.getLatLonArray();                    int n = 0;                    while (n < data.length) {                        Float lat = new Float(data[n++]);                        Float lon = new Float(data[n++]);                        _leos.writeLEDouble(Math.toDegrees(lon.doubleValue()));                        _leos.writeLEDouble(Math.toDegrees(lat.doubleValue()));                    }                }            } else {                extents = ((EsriGraphic) graphic).getExtents();                writeExtents(extents);                //Writes number of parts for shape (1)                _leos.writeLEInt(1);                poly = (OMPoly) graphic;                float[] data = poly.getLatLonArray();                //Write number of points for shape                _leos.writeLEInt(data.length / 2);                //Write the offsets to this shape                _leos.writeLEInt(0);                int n = 0;                while (n < data.length) {                    Float lat = new Float(data[n++]);                    Float lon = new Float(data[n++]);                    _leos.writeLEDouble(Math.toDegrees(lon.doubleValue()));                    _leos.writeLEDouble(Math.toDegrees(lat.doubleValue()));                }            }        }        _leos.flush();        _leos.close();        return indexData;    }