Java FileInputStream Read readFile(String fileName)

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

Description

read File

License

Open Source License

Declaration

public static InputStream readFile(String fileName) 

Method Source Code

//package com.java2s;

import java.io.FileNotFoundException;

import java.io.InputStream;

public class Main {
    public static InputStream readFile(String fileName) {
        InputStream result = null;
        try {/*from w  ww  .j a v  a2s .  c  om*/
            result = new java.io.FileInputStream(fileName);
        } catch (FileNotFoundException ex) {
            throw new IllegalArgumentException(ex);
        }
        if (result == null) {
            throw new IllegalArgumentException("Impossible to open the file.");
        }
        return result;
    }
}

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)