Java tutorial
import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; public class Main { public static void main(String[] args) { String dataSourceFile = "asdf.txt"; try (FileInputStream fin = new FileInputStream(dataSourceFile)) { byte byteData; while ((byteData = (byte) fin.read()) != -1) { System.out.print((char) byteData); } } catch (FileNotFoundException e) { ; } catch (IOException e) { e.printStackTrace(); } } }