[問題] Java IO問題
以下是程式碼
import java.io.*;
import java.util.zip.*;
public class test {
public static void main (String[] args) throws IOException {
FileInputStream fin = new FileInputStream("test.gz");
GZIPInputStream gzin = new GZIPInputStream(fin);
FileOutputStream fout = new FileOutputStream("test.txt");
int b = 0;
while ((b = gzin.read()) != -1 ) fout.write(b);
gzin.close();
fout.flush();
fout.close();
}
}
小弟很困惑
為什麼gzin.read()讀進來以後 沒有指定要放在什麼地方
然而
fout.write()卻知道要從什麼地方抓資料寫出
不知道有沒有哪位高手可以給一下指教
謝謝
--
沒有人喜歡寂寞,
只是討厭失望……
村上春樹 『挪威的森林』
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.115.84.211
推
12/28 16:49, , 1F
12/28 16:49, 1F
推
12/28 16:50, , 2F
12/28 16:50, 2F
→
12/28 16:50, , 3F
12/28 16:50, 3F
推
12/28 16:51, , 4F
12/28 16:51, 4F
→
12/28 16:57, , 5F
12/28 16:57, 5F
推
12/28 17:13, , 6F
12/28 17:13, 6F
→
12/28 17:14, , 7F
12/28 17:14, 7F
討論串 (同標題文章)