Java FileInputStream Read readFile(String filePath)

Here you can find the source of readFile(String filePath)

Description

read File

License

Apache License

Declaration

public static byte[] readFile(String filePath) throws Exception 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.File;
import java.io.FileInputStream;

public class Main {
    public static byte[] readFile(String filePath) throws Exception {
        FileInputStream fis = new FileInputStream(new File(filePath));
        byte[] bytes = new byte[fis.available()];
        fis.read(bytes);//from   w  w  w  .j  a v  a  2  s . c  o m
        fis.close();
        return bytes;
    }
}

Related

  1. readFile(String filename)
  2. readFile(String filename)
  3. readFile(String fileName)
  4. readFile(String fileName, String charset)
  5. readFile(String filePath)
  6. readFile(String filePath)
  7. readFile(String filePath)
  8. readFile(String filePath)
  9. readFile(String filePath)