    001/*
    002 * Forge Mod Loader
    003 * Copyright (c) 2012-2013 cpw.
    004 * All rights reserved. This program and the accompanying materials
    005 * are made available under the terms of the GNU Lesser Public License v2.1
    006 * which accompanies this distribution, and is available at
    007 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    008 *
    009 * Contributors:
    010 *     cpw - implementation
    011 */
    012
    013package cpw.mods.fml.common.asm.transformers.deobf;
    014
    015import java.io.IOException;
    016import java.io.InputStream;
    017import java.util.zip.ZipEntry;
    018import java.util.zip.ZipFile;
    019
    020import com.google.common.io.InputSupplier;
    021
    022public class ZipInputSupplier implements InputSupplier<InputStream> {
    023    private ZipFile zipFile;
    024    private ZipEntry zipEntry;
    025
    026    public ZipInputSupplier(ZipFile zip, ZipEntry entry)
    027    {
    028        this.zipFile = zip;
    029        this.zipEntry = entry;
    030    }
    031
    032    @Override
    033    public InputStream getInput() throws IOException
    034    {
    035        return zipFile.getInputStream(zipEntry);
    036    }
    037
    038}