title: android NULL values after reading a file into array
body: <p>first of all i need to create text file in internal storage(if file does not exists) and then to read values line by line into array. I do not understand what i do wrong, why my reading from internal memory is not detecting my file and how should i fix that? (I suppose creating file and writing to it is correct)</p>
  
  <p>How i want my data file to look like:</p>
  
  <pre><code>data
  data
  data
  data
  data
  data
  </code></pre>
  
  <p>How I write values to file:</p>
  
  <pre><code>        FileOutputStream fOut = null;
          try {
              fOut = openFileOutput("VilniusWeatherVU.txt",MODE_WORLD_READABLE);
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          }
          String v33 = "data";
          String v12 = "data";
          String v3 = "data";
          String v11 = "data";
          String v6 = "data";
          String v1 = "data";
  
          try {
              fOut.write(v33.getBytes());
          } catch (IOException e) {
              e.printStackTrace();
          }
          try {
              fOut.write(v12.getBytes());
          } catch (IOException e) {
              e.printStackTrace();
          }
          try {
              fOut.write(v3.getBytes());
          } catch (IOException e) {
              e.printStackTrace();
          }
          try {
              fOut.write(v11.getBytes());
          } catch (IOException e) {
              e.printStackTrace();
          }
          try {
              fOut.write(v6.getBytes());
          } catch (IOException e) {
              e.printStackTrace();
          }
          try {
              fOut.write(v1.getBytes());
          } catch (IOException e) {
              e.printStackTrace();
          }
  
          try {
              fOut.close();
          } catch (IOException e) {
              e.printStackTrace();
          }
  </code></pre>
  
  <p>How i read values:</p>
  
  <pre><code>String[] array = new String[6];
          int index = 0;
          try{
              // Open the file that is the first
              // command line parameter
              FileInputStream fstream = new FileInputStream("VilniusWeatherVU.txt");
              // Get the object of DataInputStream
              DataInputStream in = new DataInputStream(fstream);
              BufferedReader br = new BufferedReader(new InputStreamReader(in));
              String strLine;
              //Read File Line By Line
              while ((strLine = br.readLine()) != null)   {
                  // Print the content on the console
                  //System.out.println (strLine);
                  array[index]=strLine;
                  index++;
              }
              //Close the input stream
              in.close();
          }catch (Exception e){//Catch exception if any
              System.err.println("Error: " + e.getMessage());
          }
  </code></pre>
  
  <p>How i check my array:</p>
  
  <pre><code>    for (int i = 0; i &lt;6; i++){
         Log.v(LOG_TAG, "CHECK IF IT WORKED " + array[i]);
     }
  </code></pre>
  
  <p>What my logcat says:</p>
  
  <pre><code>11-24 16:06:56.886      359-359/app.sunshine.android.example.com.sunshine W/System.err﹕ Error: /VilniusWeatherVU.txt (No such file or directory)
  11-24 16:06:56.895      359-359/app.sunshine.android.example.com.sunshine V/MyNewMain﹕ CHECK IF IT WORKED null
  11-24 16:06:56.895      359-359/app.sunshine.android.example.com.sunshine V/MyNewMain﹕ CHECK IF IT WORKED null
  11-24 16:06:56.895      359-359/app.sunshine.android.example.com.sunshine V/MyNewMain﹕ CHECK IF IT WORKED null
  11-24 16:06:56.895      359-359/app.sunshine.android.example.com.sunshine V/MyNewMain﹕ CHECK IF IT WORKED null
  11-24 16:06:56.895      359-359/app.sunshine.android.example.com.sunshine V/MyNewMain﹕ CHECK IF IT WORKED null
  11-24 16:06:56.895      359-359/app.sunshine.android.example.com.sunshine V/MyNewMain﹕ CHECK IF IT WORKED null
  </code></pre>
  
  <p>please don't leave me alone on this one :(</p>
  
  <p>Frunk requested:</p>
  
  <p>i attempt to read from file in a different way:</p>
  
  <pre><code>        FileInputStream fin = null;
          try {
              fin = openFileInput("VilniusWeatherVU.txt");
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          }
  
          int c;
          String temp="";
          try {
              while( (c = fin.read()) != -1){
                  temp = temp + Character.toString((char)c);
              }
          } catch (IOException e) {
              e.printStackTrace();
          }
  //string temp contains all the data of the file.
          try {
              fin.close();
          } catch (IOException e) {
              e.printStackTrace();
          }
  </code></pre>
  
  <p>then i use logcat to check: </p>
  
  <pre><code>Log.v(LOG_TAG, "CHECK IF IT WORKED " + temp);
  </code></pre>
  
  <p>and what i get is:</p>
  
  <pre><code>11-24 16:24:38.345      334-334/app.sunshine.android.example.com.sunshine V/MyNewMain﹕ CHECK IF IT WORKED datadatadatadatadatadata
  </code></pre>