Java Byte Array from getBytes(ZipInputStream zipInputStream)

Here you can find the source of getBytes(ZipInputStream zipInputStream)

Description

get Bytes

License

Apache License

Declaration

protected static byte[] getBytes(ZipInputStream zipInputStream) throws IOException 

Method Source Code


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

import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;

import java.io.IOException;
import java.io.InputStream;

import java.util.zip.ZipInputStream;

public class Main {
    protected static byte[] getBytes(ZipInputStream zipInputStream) throws IOException {
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        InputStream inputStream = new BufferedInputStream(zipInputStream);
        int b;//from  ww w  .  ja v a 2  s .co m
        while ((b = inputStream.read()) != -1) {
            outputStream.write(b);
        }
        byte[] byteArray = outputStream.toByteArray();
        return byteArray;
    }
}

Related

  1. getBytes(String filePath)
  2. getBytes(String filePath, long startPos, long endPos)
  3. getBytes(String fileUrl)
  4. getBytes(String input)
  5. getBytes(ZipFile archive, ZipEntry entry)
  6. getBytes2(InputStream aStream)
  7. getBytesAndClose(InputStream in)
  8. getBytesArrayFromFile(String fileName)
  9. getBytesASCII(String s)