BufferedReader reader = null;
try {
reader = new BufferedReader(new InputStreamReader(new FileInputStream("filename.txt"), "UTF-8"));
String string = reader.readLine();
} finally {
if (reader != null) {
reader.close();
}
}
I'm dedicated agile security architect/system architect/developer with specialty of open source framework.
September 16, 2016
How To Read from a Text File in Java
How To Write to a Text File in Java
Writer writer = null;
try {
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("filename.txt"), "UTF-8"));
writer.write(string);
} finally {
if (writer != null) {
writer.close();
}
}
September 15, 2016
How to use Client Certificate Authentication in iOS App
Subscribe to:
Posts (Atom)