Android Utililty Methods ZipOutputStream Write

List of utility methods to do ZipOutputStream Write

Description

The list of methods to do ZipOutputStream Write are organized into topic(s).

Method

voidzipFile(File file, ZipOutputStream zos)
Adds a file to the current zip output stream
zos.putNextEntry(new ZipEntry(file.getName()));
BufferedInputStream bis = null;
try {
    bis = new BufferedInputStream(new FileInputStream(file));
    long bytesRead = 0;
    byte[] bytesIn = new byte[BUFFER_SIZE];
    int read = 0;
    while ((read = bis.read(bytesIn)) != -1) {
...
voidzipFile(File resFile, ZipOutputStream zipout, String rootpath)
zip File
rootpath = rootpath
        + (rootpath.trim().length() == 0 ? "" : File.separator)
        + resFile.getName();
rootpath = new String(rootpath.getBytes("8859_1"), "GB2312");
if (resFile.isDirectory()) {
    File[] fileList = resFile.listFiles();
    for (File file : fileList) {
        zipFile(file, zipout, rootpath);
...
voidzipFile(File resFile, ZipOutputStream zipout, String rootpath)
zip File
rootpath = rootpath
        + (rootpath.trim().length() == 0 ? "" : File.separator)
        + resFile.getName();
rootpath = new String(rootpath.getBytes("8859_1"), "GB2312");
if (resFile.isDirectory()) {
    File[] fileList = resFile.listFiles();
    for (File file : fileList) {
        zipFile(file, zipout, rootpath);
...
voidzipFile(File resFile, ZipOutputStream zipout, String rootpath)
zip File
rootpath = rootpath
        + (rootpath.trim().length() == 0 ? "" : File.separator)
        + resFile.getName();
rootpath = new String(rootpath.getBytes("8859_1"), "GB2312");
if (resFile.isDirectory()) {
    File[] fileList = resFile.listFiles();
    for (File file : fileList) {
        zipFile(file, zipout, rootpath);
...
voidzipFile(File resFile, ZipOutputStream zipout, String rootpath)
zip File
rootpath = rootpath
        + ((rootpath.trim().length() == 0) ? "" : File.separator)
        + resFile.getName();
rootpath = new String(rootpath.getBytes("8859_1"), "GB2312");
if (resFile.isDirectory()) {
    File[] fileList = resFile.listFiles();
    for (File file : fileList) {
        zipFile(file, zipout, rootpath);
...
voidzipFile(File resFile, ZipOutputStream zipout, String rootpath)
zip File
rootpath = rootpath
        + (rootpath.trim().length() == 0 ? "" : File.separator)
        + resFile.getName();
rootpath = new String(rootpath.getBytes(ENCODE_8859_1),
        ENCODE_GB2312);
if (resFile.isDirectory()) {
    File[] fileList = resFile.listFiles();
    for (File file : fileList) {
...
voidzipFile(File resFile, ZipOutputStream zipout, String rootpath)
zip File
rootpath = rootpath
        + (rootpath.trim().length() == 0 ? "" : File.separator)
        + resFile.getName();
rootpath = new String(rootpath.getBytes("8859_1"), HTTP.UTF_8);
BufferedInputStream in = null;
try {
    if (resFile.isDirectory()) {
        File[] fileList = resFile.listFiles();
...
voidzipFile(File resFile, ZipOutputStream zipout, String rootpath)
zip File
rootpath = rootpath
        + (rootpath.trim().length() == 0 ? "" : File.separator)
        + resFile.getName();
rootpath = new String(rootpath.getBytes("8859_1"), HTTP.UTF_8);
BufferedInputStream in = null;
try {
    if (resFile.isDirectory()) {
        File[] fileList = resFile.listFiles();
...
voidzipFile(ZipOutputStream out, File file)
zip File
BufferedInputStream origin;
byte data[] = new byte[BUFFER];
String str = file.getPath();
FileInputStream fi = new FileInputStream(str);
origin = new BufferedInputStream(fi, BUFFER);
ZipEntry entry = new ZipEntry(
        str.substring(str.lastIndexOf("/") + 1));
out.putNextEntry(entry);
...
voidzipFile(ZipOutputStream out, File file)
zip File
BufferedInputStream origin;
byte data[] = new byte[BUFFER];
String str = file.getPath();
FileInputStream fi = new FileInputStream(str);
origin = new BufferedInputStream(fi, BUFFER);
ZipEntry entry = new ZipEntry(
        str.substring(str.lastIndexOf("/") + 1));
out.putNextEntry(entry);
...