Java InputStream Create getInputStream(final File file)

Here you can find the source of getInputStream(final File file)

Description

get Input Stream

License

Open Source License

Declaration

public static FileInputStream getInputStream(final File file) 

Method Source Code


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

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

public class Main {
    public static FileInputStream getInputStream(final File file) {
        try {//from ww  w  . j  a  v  a 2 s. c o  m
            return new FileInputStream(file);
        } catch (FileNotFoundException e) {
            return null;
        }
    }

    public static FileInputStream getInputStream(final String path) {
        return getInputStream(getFile(path));
    }

    public static File getFile(final String path) {
        return new File(path);
    }
}

Related

  1. getInputStream(File tarFile)
  2. getInputStream(File tarFile)
  3. getInputStream(File TheFile)
  4. getInputStream(FileInputStream fileInput)
  5. getInputStream(final File file)
  6. getInputStream(final File file, final boolean createFile)
  7. getInputStream(final Serializable obj)
  8. getInputStream(final String fileName)
  9. getInputStream(final String sourceFolder, final Class clazz)