Here you can find the source of getInputStream(final File file)
Parameter | Description |
---|---|
file | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
static ImageInputStream getInputStream(final File file) throws IOException
//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; } }