title: get Data from text file in java
body: <p>I have text file <code>a.txt</code> and I want to a methode like  <code>public String[] getdata(String filename,int nbrLine){}</code> that I give two parameters the name of the file (<code>a.txt</code>) and the number of the line  that I want to put in <code>String[]</code>.</p>
  
  <p>I have text file <code>a.txt</code></p>
  
  <pre><code>1,2,3,5,0
  7,2,3,5,4,7
  9,2
  1,0,0,2`
  </code></pre>
  
  <p>I try something like </p>
  
  <pre><code>public String LoadDataB(String inFile) {
       String tContents = "";
       try {
           InputStream stream = getAssets().open(inFile);
           byte[] buffer = new byte[stream.available()];
           stream.read(buffer);
           stream.close();
           return new String(buffer);
       } catch (IOException e) {
           return tContents;
       }
   }
  </code></pre>
  
  <p>But how can I complete it?</p>