Java FileInputStream Read readFile(final String fileNamePath)

Here you can find the source of readFile(final String fileNamePath)

Description

read File

License

Open Source License

Declaration

public static byte[] readFile(final String fileNamePath) throws IOException 

Method Source Code

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

import java.io.FileInputStream;

import java.io.IOException;

public class Main {

    public static byte[] readFile(final String fileNamePath) throws IOException {
        FileInputStream input = null;
        byte[] daten = null;
        try {// w  ww  .j  a v  a 2 s .  c  om
            input = new FileInputStream(fileNamePath);
            daten = new byte[input.available()];
            input.read(daten);
        } finally {
            if (input != null) {
                input.close();
            }
        }
        return daten;
    }
}

Related

  1. readFile(FileInputStream fileinputstream, byte abyte0[])
  2. readFile(final File file)
  3. readFile(final File file)
  4. readFile(final File file)
  5. readFile(final InputStream stream)
  6. readFile(InputStream ios)
  7. readFile(InputStream iStream)
  8. readFile(String destination)
  9. readFile(String file)