Java FileInputStream Read readFile(File f)

Here you can find the source of readFile(File f)

Description

read File

License

Open Source License

Declaration

public static byte[] readFile(File f) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    public static byte[] readFile(File f) throws IOException {
        DataInputStream in = new DataInputStream(new FileInputStream(f));
        byte[] ret = new byte[(int) f.length()];
        in.readFully(ret);/* ww w .j a va  2s.c o m*/
        in.close();
        return ret;
    }
}

Related

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