Java tutorial
import java.io.FileInputStream; public class Main { public static void main(String[] argv) throws Exception { FileInputStream fin = new FileInputStream("test.txt"); int i; do { i = fin.read(); if (i != -1) System.out.printf("%02X ", i); } while (i != -1); fin.close(); } }