Here you can find the source of readFile(File f, int fetchLength, byte[] bytes)
public static int readFile(File f, int fetchLength, byte[] bytes) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; public class Main { public static int readFile(File f, int fetchLength, byte[] bytes) throws IOException { InputStream fileStream = new FileInputStream(f); fetchLength = fileStream.read(bytes, 0, bytes.length); fileStream.close();// www. jav a2 s . c om return fetchLength; } }