Here you can find the source of decompressAndB64DecodeUTF8Bytes(byte[] b64EncodedCompressedBytes)
public static char[] decompressAndB64DecodeUTF8Bytes(byte[] b64EncodedCompressedBytes) throws Exception
//package com.java2s; //License from project: Apache License import java.io.ByteArrayOutputStream; import java.util.zip.Inflater; import com.amazonaws.util.Base64; public class Main { public static char[] decompressAndB64DecodeUTF8Bytes(byte[] b64EncodedCompressedBytes) throws Exception { byte[] input = Base64.decode(b64EncodedCompressedBytes); // Compressor with highest level of compression Inflater inflater = new Inflater(); // Give the compressor the data to compress inflater.setInput(input);/*from www . j a v a 2 s . c o m*/ ByteArrayOutputStream stream = new ByteArrayOutputStream(); byte[] buf = new byte[32]; while (!inflater.finished()) { int count = inflater.inflate(buf); stream.write(buf, 0, count); } return new String(stream.toByteArray(), "UTF-8").toCharArray(); } }