Uncompress the input as a String of the given encoding

@param input
@param encoding
@return the uncompressed data
@throws IOException
@throws UnsupportedEncodingException
333442
public static String uncompressString(byte[] input, String encoding)
            throws IOException,
            UnsupportedEncodingException
    {
        byte[] uncompressed = uncompress(input);
        return new String(uncompressed, encoding);
    }
373491
private static byte[] gzip(final InputStream input)
        throws IOException {
        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
        // @checkstyle MagicNumberCheck (1 line)
        final byte[] buf = new byte[4096];
        final OutputStream gzip = new GZIPOutputStream(baos);
        try {
            while (true) {
                final int len = input.read(buf);
                if (len < 0) {
                    break;
                }
                gzip.write(buf, 0, len);
            }
        } finally {
            gzip.close();
            input.close();
        }
        return baos.toByteArray();
    }
424824
public static ByteBuffer decode(String input) throws IOException {
		return decode(input.getBytes(StandardCharsets.US_ASCII));
	}
257617
public void setOutput(OutputStream stream, String encoding)
    throws UnsupportedEncodingException {
        
        if (encoding == null) {
            encoding = "UTF8";
        }
        
        java.io.Writer writer = new OutputStreamWriter(stream, encoding);
        fOut = new PrintWriter(writer);
        
    }
1236168
public void setEncoding(String encoding)
    throws UnsupportedEncodingException
  {
    if (encoding != null) {
      _readEncoding = Encoding.getReadEncoding(this, encoding);
      _readEncodingName = Encoding.getMimeName(encoding);
    }
    else {
      _readEncoding = null;
      _readEncodingName = null;
    }
  }
754088
public static String compressStringToBase64String(String value) throws IOException {
        return new String(Base64.encode(compressString(value)), StandardCharsets.UTF_8);
    }
176430
function(/**string*/ encoding) {
		if (/UTF-8/i.test(encoding)) {
			IO.encoding = "utf8";
		}
		else if (/ASCII/i.test(encoding)) {
			IO.encoding = "ascii";
		}
		else {
			throw("Unsupported encoding: "+encoding+" - perhaps you can use UTF-8?");
		}
	}
1240467
public static byte[] toUnixLineEndings( InputStream input ) throws IOException {
        String encoding = "ISO-8859-1";
        FixCrLfFilter filter = new FixCrLfFilter(new InputStreamReader(input, encoding));
        filter.setEol(FixCrLfFilter.CrLf.newInstance("unix"));

        ByteArrayOutputStream filteredFile = new ByteArrayOutputStream();
        Utils.copy(new ReaderInputStream(filter, encoding), filteredFile);

        return filteredFile.toByteArray();
    }
312351
public static void main (String[] args) throws UnsupportedEncodingException
    {
        byte[] bytes = encode(args[0].getBytes(ZIP_CHARSET));
          System.out.println(new String(bytes, ZIP_CHARSET));
    }
1132886
public static void unzipFile(File input, File output) throws IOException {
		try (FileInputStream fis = new FileInputStream(input)) {
			unzipFile(fis, output);
		}
	}
23510
public String convertToJavaString(String input, boolean useUnicode) {
		int length = input.length();
		StringBuilder result = new StringBuilder(length + 4);
		for (int i = 0; i < length; i++) {
			escapeAndAppendTo(input.charAt(i), useUnicode, result);
		}
		return result.toString();
	}
544588
public static StringBuilder encodeBytes(final StringBuilder iOutput, final byte[] source) {
		if (source != null) {
			// Since we're not going to have the GZIP encoding turned on,
			// we're not going to have an java.io.IOException thrown, so
			// we should not force the user to have to catch it.
			try {
				iOutput.append(encodeBytes(source, 0, source.length, NO_OPTIONS));
			} catch (java.io.IOException ex) {
				assert false : ex.getMessage();
			}
		}
		return iOutput;
	}
316070
public static String compress(String uncompressedValue) throws IOException {
        if (uncompressedValue == null)
            return null;
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        GZIPOutputStream gzip = null;
        try {
            gzip = new GZIPOutputStream(out);
            gzip.write(uncompressedValue.getBytes());
            gzip.close();
            return out.toString("ISO-8859-1");
        }
        finally {
            if (gzip != null)
                gzip.close();
        }
    }
302389
public void setInputEncoding(String encoding) {
        if (StringUtils.isNotEmpty(encoding)) {
            Charset.forName(encoding);
            this.encoding = encoding;
        }
    }
471740
public void setInputEncoding(String inputEncoding) {
        this.log("Setting input encoding to " + inputEncoding, LogLevel.DEBUG.getLevel());
        this.inputEncoding = inputEncoding;
    }
1103768
private void encodeFullRevisionUncompressed(final DiffPart part)
		throws UnsupportedEncodingException, EncodingException
	{

		// C
		data.writeBit(0);
		data.writeBit(0);
		data.writeBit(1);

		// L T
		String text = part.getText();
		byte[] bText = text.getBytes(WIKIPEDIA_ENCODING);

		data.writeValue(codecData.getBlocksizeL(), bText.length);
		data.write(bText);

	}
515949
static String unescapeText(String input)
    {
        ByteBuffer buffer = unescapeBytes(input);
        return new String(buffer.array(), buffer.position(), buffer.limit(), ISO_8859_1);
    }