Java InputStream Read getInputstream(File compressedFile)

Here you can find the source of getInputstream(File compressedFile)

Description

Gets the compressed input stream for an image

License

Open Source License

Parameter

Parameter Description
compressedFile The compressed file to get the InputStream for

Return

the for the passed file

Declaration

public static InputStream getInputstream(File compressedFile) 

Method Source Code

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

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

import java.io.InputStream;
import java.util.zip.GZIPInputStream;

public class Main {
    /**//w w w  .  j  a v  a2s.  c o m
     * Gets the compressed input stream for an image
     *
     * @param compressedFile The compressed file to get the {@link InputStream} for
     * @return the {@link InputStream} for the passed file
     */
    public static InputStream getInputstream(File compressedFile) {
        try {
            return new GZIPInputStream(new FileInputStream(compressedFile));
        }

        catch (Exception e) {
            e.printStackTrace();
        }

        return null;
    }
}

Related

  1. getFileContent(InputStream inputStream)
  2. getFileContent(InputStream is)
  3. getFileContent(InputStream stream)
  4. getInputStream(Class clazz)
  5. getInputStream(Class ownerClass, String subName, String extension)
  6. getInputStream(JarFile file, ZipEntry entry)
  7. getInputStream(Object caller, String name)
  8. getInputStreamAsResource(Class clazz, String fileName)
  9. getInputStreamFile(String URLString)