public void write(DataOutput dos) throws IOException {
  int length=(points.length / 2) * 2;
  dos.writeInt(length);
  for (int i=0; i < length; i++) {
    dos.writeFloat(points[i]);
  }
}

public void write ( DataOutput dos ) throws IOException { int length = ( points . length / 2 ) * 2 ; dos . writeInt ( length ) ; for ( int i = 0 ; i < length ; i ++ ) { dos . writeFloat ( points [ i ] ) ; } }
write the polygon on the output stream . if the number of points is an odd number , the last number will be left off .
