Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ Android Unzip the ZIP / GZIP data (based on the InflaterInputStream implementation)     - DRBD + Heartbeat solve NFS single point of failure (Server)

- Bash command substitution (Programming)

- Enable Intel Rapid Start in GNU / Linux (Linux)

- Linux system on a virtual machine to access the Internet (Linux)

- Spring AOP custom annotation way to achieve log management (Programming)

- Linux Getting Started Tutorial: Ubuntu laptop screen brightness adjustment (Linux)

- Kali Linux resolve GPG error KEYEXPIRED 1425567400 (Linux)

- OpenSUSE 13.1 OpenSUSE 12.3 and how to install Cinnamon 2.2 Desktop (Linux)

- Linux - Common process the command (Linux)

- Oracle how to maintain the consistency of read? (Database)

- Ubuntu 12.04 installation OpenCV2.4.1 and compile test (Linux)

- Python uses multi-process pool (Programming)

- MySQL simple operation notes under Linux (Database)

- Get and Post requests Comments (Linux)

- IronPython and C # to interact (Programming)

- Ubuntu users to install Gnome-Pie 0.6.5 (Linux)

- Present Situation and Development Trend of firewall products (Linux)

- PXE + Kickstart automatically install CentOS 6.5 (Linux)

- Linux Shell Scripting Interview Question (Linux)

- Ubuntu install video conversion tool Selene (Linux)

  Android Unzip the ZIP / GZIP data (based on the InflaterInputStream implementation)
  Add Date : 2017-08-31      
  In the actual use of the project code, found that if the standard library with the Java library specified GZIPInputStream read compressed data decompression can not be stable, for unknown reasons. Instead, use InflaterInputStream can replace GZIPInputStream stable, normal work, and now the InflaterInputStream based on the zip \ gzip codec code tool method is given:

Public static byte [] decompress (byte [] compress) throws Exception {
   ByteArrayInputStream bais = new ByteArrayInputStream (compress);
   InflaterInputStream iis = new InflaterInputStream (bais);

   ByteArrayOutputStream baos = new ByteArrayOutputStream ();

   Int c = 0;
   Byte [] buf = new byte [BUFFER_SIZE];
   While (true) {
    C = iis.read (buf);

    If (c == EOF)

    Baos.write (buf, 0, c);

   Baos.flush ();

   Return baos.toByteArray ();

Where, EOF = -1, BUFFER_SIZE value can be customized according to their own projects.
- Spark and Hadoop comparison (Server)
- Android engineers interview questions (Programming)
- Apache POI Excel Document Processing (Linux)
- Let you Fun Ubuntu desktop eleven weapon (Linux)
- wget command usage Explanation (Linux)
- Python when automated operation and maintenance often used method (Programming)
- Ubuntu 15.04 / 14.04 install Ubuntu After Install 2.6 (Linux)
- Oracle database physical file backup / restore (Database)
- Programmer editor Vim (Linux)
- Linux iptables firewall and vsftpd to resolve the issue (Linux)
- Android development, may cause a memory leak problem (Programming)
- findmnt- Looking mounted file system (Linux)
- Some of the bibliographic management tools to good use on linux (Linux)
- CentOS How quickly customize kernel binary RPM package (Linux)
- Linux NFS FTP use (Server)
- Ubuntu 14.04 / 14.10 how to install FFmpeg 2.5.1 (Linux)
- How do you prevent other users from accessing your home directory in Linux (Linux)
- MySQL / MariaDB database master-slave replication (Database)
- New features of Java 9 HTTP2 and REPL (Programming)
- Java 8 Lambda principle analysis (Programming)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.