Java InputStream Read getInputStreamFromClassPath(String filename)

Here you can find the source of getInputStreamFromClassPath(String filename)

Description

get Input Stream From Class Path

License

Apache License

Parameter

Parameter Description
filename a parameter

Declaration

public static InputStream getInputStreamFromClassPath(String filename) 

Method Source Code

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

import java.io.InputStream;

public class Main {
    /**/*from w  w w .j av  a  2s. c  om*/
     * 
     * @param filename
     * @return
     */
    public static InputStream getInputStreamFromClassPath(String filename) {
        return Thread.currentThread().getContextClassLoader().getResourceAsStream(filename);
    }
}

Related

  1. getInputStreamFor(String path, Class clazz)
  2. getInputStreamForFileAbsolutePath(String _path)
  3. getInputStreamForResource(String name)
  4. getInputStreamForResource(String relativePath)
  5. getInputStreamFromAbsolutePath(String resource)
  6. getInputStreamFromFile(File pFile)
  7. getInputStreamFromFile(final File file)
  8. getInputStreamFromZip(ZipInputStream zis, String filename)
  9. getInputStreamLength(InputStream in)