Here you can find the source of uncompress(String compressedValue)
public static String uncompress(String compressedValue) throws IOException
//package com.java2s; /*/*from w w w . j a va2 s.c o m*/ * Copyright (C) 2017 CenturyLink, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; import java.util.zip.GZIPInputStream; public class Main { /** * Uncompress a string value that was compressed using GZIP. */ public static String uncompress(String compressedValue) throws IOException { if (compressedValue == null) return null; ByteArrayInputStream in = new ByteArrayInputStream(compressedValue.getBytes("ISO-8859-1")); GZIPInputStream gzip = null; Reader reader = null; try { String value = ""; gzip = new GZIPInputStream(in); reader = new InputStreamReader(gzip, "ISO-8859-1"); int i; while ((i = reader.read()) != -1) value += (char) i; return value; } finally { if (gzip != null) gzip.close(); if (reader != null) reader.close(); } } }