public static byte[] checkIndexHeaderID(DataInput in,byte[] expectedID) throws IOException {
  byte id[]=new byte[StringHelper.ID_LENGTH];
  in.readBytes(id,0,id.length);
  if (!Arrays.equals(id,expectedID)) {
    throw new CorruptIndexException("file mismatch, expected id=" + StringHelper.idToString(expectedID) + ", got="+ StringHelper.idToString(id),in);
  }
  return id;
}

public static byte [ ] checkIndexHeaderID ( DataInput in , byte [ ] expectedID ) throws IOException { byte id [ ] = new byte [ StringHelper . ID_LENGTH ] ; in . readBytes ( id , 0 , id . length ) ; if ( ! Arrays . equals ( id , expectedID ) ) { throw new CorruptIndexException ( "file mismatch, expected id=" + StringHelper . idToString ( expectedID ) + ", got=" + StringHelper . idToString ( id ) , in ) ; } return id ; }
expert : just reads and verifies the object id of an index header
