📄 main.java
字号:
import java.io.*;
import java.util.zip.*;
class Main {
public static void main(String[] args) {
try {
MyGZIPInputStream is = new MyGZIPInputStream(System.in);
byte[] buf = new byte[1024];
int len;
while (!is.getEos()) {
len = is.read(buf);
if (len > 0) {
System.out.write(buf, 0, len);
}
}
is.close();
System.err.println("\nThe checksum is: " +
is.getChecksum().getValue());
} catch (Exception e) {
e.printStackTrace();
}
}
}
class MyGZIPInputStream extends GZIPInputStream {
MyGZIPInputStream(InputStream in) throws IOException {
super(in);
}
boolean getEos() {
return eos;
}
Checksum getChecksum() {
return crc;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -