Java InputStream Create getInputStream(final File file)

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

Description

Retrieves an ImageInputStream for the provided input File .

License

LGPL

Parameter

Parameter Description
file a parameter

Exception

Parameter Description
IOException an exception

Declaration

static ImageInputStream getInputStream(final File file) throws IOException 

Method Source Code

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

import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

import javax.imageio.stream.ImageInputStream;

public class Main {
    /**//from  www.j  a v a 2 s.c  o m
     * Retrieves an {@link ImageInputStream} for the provided input {@link File}
     * .
     * 
     * @param file
     * @return
     * @throws IOException
     */
    static ImageInputStream getInputStream(final File file) throws IOException {
        final ImageInputStream inStream = ImageIO.createImageInputStream(file);
        if (inStream == null)
            return null;
        return inStream;
    }
}

Related

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