java - How can read text file from position -


i'm trying develop application can read files. don't know how can change position of reader pointer, please?

for(int i=0; i<tab.length; i++){      char cbuf[] = new char[tab[i]];      try {         inputstream ips=new fileinputstream(fichier);          inputstreamreader ipsr=new inputstreamreader(ips);         bufferedreader br=new bufferedreader(ipsr);                      //i need change position of pointer here         br.read(cbuf, 0, tab[i]);           tabs[i] = new string(cbuf);         system.out.println(tabs[i]);          br.close();     } catch (exception e){         system.out.println(e.tostring());     } } 

the read command lets take in next character. use loop take in characters

// reads , prints bufferedreader      int alength = 10;      int array[] = new int [alength];      int value = 0;      int index = 0;      while((value = br.read()) != -1 && index < alength)      {          array[index++] = value;      } 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -