April 05
Prof. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
Exemplo de Leitura de Arquivo
ntry {
n  Reader r = new FileReader("test.txt");
n  int c;
n  while( (c=r.read()) != -1 ) {
n    System.out.println("Li caracter "+(char)c);
n  }
n} catch( FileNotFoundException e ) {
n  System.out.println("test.txt não existe");
n} catch( IOException e ) {
n  System.out.println("Erro de leitura");
n} finaly {
n  if( r != null )
n   r.close();
n}
n