集册 Java实例教程 从Zip文件中提取文件

从Zip文件中提取文件

欢马劈雪     最近更新时间:2020-01-02 10:19:05

477
从Zip文件中提取文件
/**
n o w j a v a . c o m 提供 
**/


//package com.nowjava;

import java.io.*;


import java.util.zip.ZipInputStream;


public class Main {

    private static void extractFile(ZipInputStream in,

            File outputDirectory, String name) throws IOException {

        final int BUFFER_SIZE = 1024;

        byte[] buffer = new byte[BUFFER_SIZE];

        BufferedOutputStream out = new BufferedOutputStream(

                new FileOutputStream(new File(outputDirectory, name)));

        int count;

        
展开阅读全文