Java FileInputStream Read readFile(String fileName)

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

Description

read File

License

Apache License

Declaration

public static byte[] readFile(String fileName) throws IOException 

Method Source Code

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

import java.io.FileInputStream;
import java.io.IOException;

public class Main {
    public static byte[] readFile(String fileName) throws IOException {
        FileInputStream is = new FileInputStream(fileName);
        byte[] b = null;
        try {//from  www.  ja va 2  s. c om
            b = new byte[is.available()];
            is.read(b);
        } finally {
            is.close();
        }
        return b;
    }
}

Related

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