protected void readHeader() throws IOException {
  header=new byte[ShapeUtils.SHAPE_FILE_HEADER_LENGTH];
  raf.seek(0);
  raf.read(header,0,ShapeUtils.SHAPE_FILE_HEADER_LENGTH);
  int fileCode=ShapeUtils.readBEInt(header,0);
  if (fileCode != SHAPE_FILE_CODE) {
    throw new IOException("Invalid file code, " + "probably not a shape file");
  }
  fileVersion=ShapeUtils.readLEInt(header,28);
  if (fileVersion != SHAPE_FILE_VERSION) {
    throw new IOException("Unable to read shape files with version " + fileVersion);
  }
  fileLength=ShapeUtils.readBEInt(header,24);
  fileLength*=2;
  fileShapeType=ShapeUtils.readLEInt(header,32);
  fileBounds=ShapeUtils.readBox(header,36);
}

protected void readHeader ( ) throws IOException { header = new byte [ ShapeUtils . SHAPE_FILE_HEADER_LENGTH ] ; raf . seek ( 0 ) ; raf . read ( header , 0 , ShapeUtils . SHAPE_FILE_HEADER_LENGTH ) ; int fileCode = ShapeUtils . readBEInt ( header , 0 ) ; if ( fileCode != SHAPE_FILE_CODE ) { throw new IOException ( "Invalid file code, " + "probably not a shape file" ) ; } fileVersion = ShapeUtils . readLEInt ( header , 28 ) ; if ( fileVersion != SHAPE_FILE_VERSION ) { throw new IOException ( "Unable to read shape files with version " + fileVersion ) ; } fileLength = ShapeUtils . readBEInt ( header , 24 ) ; fileLength *= 2 ; fileShapeType = ShapeUtils . readLEInt ( header , 32 ) ; fileBounds = ShapeUtils . readBox ( header , 36 ) ; }
reads and parses the header of the file . values from the header are stored in the fields of this class .
