JAR FASTJSON 1.2.1
String input=“base64”;
byte[] bytes = Base64.decodeFast(input);
try (GZIPInputStream gis = new GZIPInputStream(new ByteArrayInputStream(bytes))) {
try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
int count;
byte data[] = new byte[1024];
while ((count = gis.read(data, 0, 1024)) != -1) {
baos.write(data, 0, count);
}
System.out.println(new String(baos.toByteArray(), "utf-8"));
} catch (IOException e) {
//logger.error(String.format("decompressString error: %s, string:%s, ", e.getMessage(), input, e));
throw e;
}
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
io 解析base64 数据小计