Personally I'm reading from a .txt file and would like to save all the strings how could I save it all? Below is my writing code that I'm using, in case I'd like to save the String line.
public static void main(String[] args) throws IOException {
try {
File f = new File ("c:/teste.txt");
InputStream is = new FileInputStream("c:/teste.txt");
InputStreamReader isr = new InputStreamReader(is);
BufferedReader reader = new BufferedReader(isr);
String linha = reader.readLine();
while (linha != null) {
System.out.println(linha);
linha = reader.readLine();
}
reader.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}