public void testPolyline() throws Exception {
  EsriLayer layer=new EsriLayer("Drawable Layer",SHAPE_TYPE_POLYLINE,2);
  DbfTableModel model=layer.getModel();
  model.setDecimalCount(0,(byte)0);
  model.setLength(0,(byte)20);
  model.setColumnName(0,"Column1");
  model.setType(0,(byte)DbfTableModel.TYPE_CHARACTER);
  model.setDecimalCount(1,(byte)3);
  model.setLength(1,(byte)20);
  model.setColumnName(1,"Column2");
  model.setType(1,(byte)DbfTableModel.TYPE_NUMERIC);
  addPolylineRecord1(layer);
  addPolylineRecord2(layer);
  addPolylineRecord3(layer);
  EsriGraphicList list=layer.getEsriGraphicList();
  ShpOutputStream pos=new ShpOutputStream(new FileOutputStream("polylinetest0.shp"));
  int[][] indexData=pos.writeGeometry(list);
  ShxOutputStream xos=new ShxOutputStream(new FileOutputStream("polylinetest0.shx"));
  xos.writeIndex(indexData,list.getType(),list.getExtents());
  DbfOutputStream dos=new DbfOutputStream(new FileOutputStream("polylinetest0.dbf"));
  dos.writeModel(model);
}

public void testPolyline ( ) throws Exception { EsriLayer layer = new EsriLayer ( "Drawable Layer" , SHAPE_TYPE_POLYLINE , 2 ) ; DbfTableModel model = layer . getModel ( ) ; model . setDecimalCount ( 0 , ( byte ) 0 ) ; model . setLength ( 0 , ( byte ) 20 ) ; model . setColumnName ( 0 , "Column1" ) ; model . setType ( 0 , ( byte ) DbfTableModel . TYPE_CHARACTER ) ; model . setDecimalCount ( 1 , ( byte ) 3 ) ; model . setLength ( 1 , ( byte ) 20 ) ; model . setColumnName ( 1 , "Column2" ) ; model . setType ( 1 , ( byte ) DbfTableModel . TYPE_NUMERIC ) ; addPolylineRecord1 ( layer ) ; addPolylineRecord2 ( layer ) ; addPolylineRecord3 ( layer ) ; EsriGraphicList list = layer . getEsriGraphicList ( ) ; ShpOutputStream pos = new ShpOutputStream ( new FileOutputStream ( "polylinetest0.shp" ) ) ; int [ ] [ ] indexData = pos . writeGeometry ( list ) ; ShxOutputStream xos = new ShxOutputStream ( new FileOutputStream ( "polylinetest0.shx" ) ) ; xos . writeIndex ( indexData , list . getType ( ) , list . getExtents ( ) ) ; DbfOutputStream dos = new DbfOutputStream ( new FileOutputStream ( "polylinetest0.dbf" ) ) ; dos . writeModel ( model ) ; }
creates a polyline shape file set
