Java FileInputStream Read readFile(String filePath)

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

Description

This method reads a file at specfied path and returns its inputStream.

License

LGPL

Parameter

Parameter Description
filePath - Path of the file whose input stream is desired

Exception

Parameter Description
FileNotFoundException the file not found exception

Return

InputStream of the file

Declaration

public static InputStream readFile(String filePath) throws FileNotFoundException 

Method Source Code

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

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

import java.io.InputStream;

public class Main {
    /**/*  www.j  a  v  a  2  s.  com*/
     * This method reads a file at specfied path and returns its inputStream.
     *
     * @param filePath - Path of the file whose input stream is desired
     * @return InputStream of the file
     * @throws FileNotFoundException the file not found exception
     */
    public static InputStream readFile(String filePath) throws FileNotFoundException {
        File file = new File(filePath);
        return new FileInputStream(file);

    }
}

Related

  1. readFile(String filePath)
  2. readFile(String filePath)
  3. readFile(String filePath)
  4. readFile(String filePath)
  5. readFile(String filePath)
  6. readFile(String filePath)
  7. readFile(String filePathName)
  8. readFile(String fname)
  9. readFile(String fname)