Here you can find the source of readSomeDataFromFile(String path, byte[] data)
public static void readSomeDataFromFile(String path, byte[] data)
//package com.java2s; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; public class Main { public static void readSomeDataFromFile(String path, byte[] data) { InputStream is = null;/*from w ww . j av a 2s . co m*/ try { File file = new File(path); is = new FileInputStream(file); is.read(data); } catch (IOException e) { e.printStackTrace(); } finally { try { if (is != null) { is.close(); } } catch (IOException e) { e.printStackTrace(); } } } }