System.out.println("Input String length : " + str.length());
System.out.println("SWB==="+sw.getTime());
byte[] bytes = Base64.decodeBase64(str);
System.out.println("SWB==="+sw.getTime());
GZIPInputStream gis = new GZIPInputStream(new ByteArrayInputStream(bytes));
BufferedReader bf = new BufferedReader(new InputStreamReader(gis));
String outStr = "";
String line;
while ((line=bf.readLine())!=null) {
outStr += line;
}
System.out.println("SWB==="+sw.getTime());
System.out.println("Output String lenght : " + outStr.length());
上記のコードが出力されます
SWB===1
SWB===4
SWB===27052
Output String lenght : 1750825
しかし、同じ文字列の圧縮には非常に短い時間 (100 ミリ秒未満) しかかかりません。ここで何が間違っていますか?(デバッグコメントの私の悪い方法を除いて)