private void ensureFileOpen(){
  if (savingDisabled) {
    Log.e(TAG,"Saving disabled but tried to ensureFileOpen");
    return;
  }
  if (saveFileStream != null)   return;
  File saveFile=new File(ctx.getFilesDir(),SAVEFILE);
  try {
    FileOutputStream fileOutput=null;
    DataOutputStream out=null;
    if (saveFile.exists()) {
      fileOutput=ctx.openFileOutput(SAVEFILE,Context.MODE_APPEND);
      out=new DataOutputStream(new BufferedOutputStream(fileOutput));
    }
 else {
      fileOutput=ctx.openFileOutput(SAVEFILE,Context.MODE_PRIVATE);
      out=new DataOutputStream(new BufferedOutputStream(fileOutput));
      out.writeInt(TrackPoint.FORMAT_VERSION);
      savedTrackPoints=0;
    }
    saveFileStream=out;
  }
 catch (  Exception e) {
    markSavingBroken("Failed to open track save file",e);
  }
}

private void ensureFileOpen ( ) { if ( savingDisabled ) { Log . e ( TAG , "Saving disabled but tried to ensureFileOpen" ) ; return ; } if ( saveFileStream != null ) return ; File saveFile = new File ( ctx . getFilesDir ( ) , SAVEFILE ) ; try { FileOutputStream fileOutput = null ; DataOutputStream out = null ; if ( saveFile . exists ( ) ) { fileOutput = ctx . openFileOutput ( SAVEFILE , Context . MODE_APPEND ) ; out = new DataOutputStream ( new BufferedOutputStream ( fileOutput ) ) ; } else { fileOutput = ctx . openFileOutput ( SAVEFILE , Context . MODE_PRIVATE ) ; out = new DataOutputStream ( new BufferedOutputStream ( fileOutput ) ) ; out . writeInt ( TrackPoint . FORMAT_VERSION ) ; savedTrackPoints = 0 ; } saveFileStream = out ; } catch ( Exception e ) { markSavingBroken ( "Failed to open track save file" , e ) ; } }
opens the savefilestream if necessary
