Here you can find the source of getInputStream(File jarFile, String fileName)
public static InputStream getInputStream(File jarFile, String fileName) throws ZipException, IOException
//package com.java2s; /******************************************************************************* * Copyright (c) 2010 Angelo Zerr and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors:/*from w w w . j a v a 2 s . c om*/ * Angelo Zerr <angelo.zerr@gmail.com> - Initial API and implementation *******************************************************************************/ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.zip.ZipEntry; import java.util.zip.ZipException; import java.util.zip.ZipFile; public class Main { public static InputStream getInputStream(File jarFile, String fileName) throws ZipException, IOException { ZipFile zipFile = new ZipFile(jarFile); ZipEntry zipEntry = zipFile.getEntry(fileName); return zipFile.getInputStream(zipEntry); } }