Lendo arquivo caracter por caracter!

1 resposta
J

Dae galera!! Alguém teria algum exemplo ou links como se trabalha com arquivos lendo caracter por caracter?
Valeu!!!

1 Resposta

P

Pegaê,

public void carregarArquivo(String NomeArquivo)
{
BufferedReader BR = null;
		
try
{
	String Linha = null;
	
	BR = new BufferedReader(new FileReader(NomeArquivo));
			
	while ((Linha = BR.readLine()) != null)
	{
	//AQUI VC USA UM LOOP COM Linha.length() E O METODO charAt()
	}
			
	BR.close();
}
catch (FileNotFoundException e)
{
	//System.out.println(e.toString());

	return null;
}
catch (IOException e)
{
	//System.out.println(e.toString());
			
	return null;
}
}
Criado 6 de outubro de 2006
Ultima resposta 6 de out. de 2006
Respostas 1
Participantes 2