The code snippet below reads a file into byte array.

Java Code:
File file = new File("C:\\abc.jpg");
byte[] fileBArray = new byte[(int)file.length()];
FileInputStream fis = new FileInputStream(file);
fis.read(fileBArray);