Created
July 9, 2020 08:14
-
-
Save BMU-Verlag/ab571c367596c9f80533171ac91789fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String dateiEinlesen(String dateiname){ | |
try{ | |
FileInputStream fis = new FileInputStream(dateiname); | |
InputStreamReader isr = new InputStreamReader(fis); | |
BufferedReader br = new BufferedReader(isr); | |
String linie = br.readLine(); | |
String inhalt = ""; | |
while (linie != null){ | |
inhalt += linie; | |
linie = br.readLine(); | |
} | |
br.close(); | |
return inhalt; | |
} | |
catch (IOException ioAusnahme){ | |
System.out.println("Datei konnte nicht geöffnet werden."); | |
return "Fehler"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment