Java FileInputStream Read readFile(File f, int fetchLength, byte[] bytes)

Here you can find the source of readFile(File f, int fetchLength, byte[] bytes)

Description

read File

License

Open Source License

Declaration

public static int readFile(File f, int fetchLength, byte[] bytes) throws IOException 

Method Source Code

//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;
    }
}

Related

  1. readFile(File f)
  2. readFile(File f)
  3. readFile(File f)
  4. readFile(File f)
  5. readFile(File f)
  6. readFile(File f, int iChunkSize)
  7. readFile(File file)
  8. readFile(File file)
  9. readFile(File file)