Ler arquivo texto

1 resposta
P

ola, existe algum metodo para ler um arquivo texto caracter por caracter?

1 Resposta

G
File f = new File(arquivo.txt);

byte[] b = new byte[1];

int i = 0;

FileInputStream fi = new FileInputStream(f);

while ((i=fi.read(b)) > -1) {

System.out.println(new String(b));

}

fi.close();
Criado 11 de setembro de 2007
Ultima resposta 11 de set. de 2007
Respostas 1
Participantes 2