try{ FileInputStream fi = new FileInputStream("hs.txt");DataInput load = new DataInputStream(fi);}catch (IOException e) {System.out.print(" "+e);}String line;try{ while ((line=load.readLine()) !=null) { ...//Datei wird verarbeitet } load.close(); } catch (IOException e) { System.out.print(" "+e);}