Skynet
posts - 165, comments - 198, trackbacks - 0, articles - 1
BlogJava
::
首頁(yè)
::
新隨筆
::
聯(lián)系
::
聚合
::
管理
java gzip (使用,亂碼問題已解決!)
Posted on 2008-12-22 14:35
G_G
閱讀(3623)
評(píng)論(0)
編輯
收藏
所屬分類:
javaGeneral
????
public
?
static
?
void
?main(String[]?args)?
{
????????
try
?
{
????????
?????????String?charset?
=
?
"
UTF-8
"
;
?????????String?outfile?
=
?
"
d:\\category.20081218.gz
"
;
?????????BufferedReader?in?
=
?
new
?BufferedReader(
??????????
new
?InputStreamReader(
??????????
new
?FileInputStream(
"
d:\\category.20081218
"
),
??????????charset));
??????????
??????????BufferedOutputStream?out?
=
????????????
new
?BufferedOutputStream(
??????????????
new
?GZIPOutputStream(
????????????????
new
?FileOutputStream(outfile)));
??????????
??????????
??????????System.out.println(
"
Writing?file
"
);
??????????String?c;
??????????
while
((c?
=
?in.readLine())
!=
null
)
????????????out.write(?(c
+
"
\n
"
).getBytes(charset));
??????????in.close();
??????????out.close();
??????????System.out.println(
"
Reading?file
"
);
??????????BufferedReader?in2?
=
????????????
new
?BufferedReader(
??????????????
new
?InputStreamReader(
????????????????
new
?GZIPInputStream(
??????????????????
new
?FileInputStream(outfile)
??????????????????),charset
????????????????)
??????????????);
??????????String?s;
??????????
while
((s?
=
?in2.readLine())?
!=
?
null
)
????????????System.out.println(s);
????????}
?
catch
(Exception?e)?
{
??????????e.printStackTrace();
????????}
??????}
新用戶注冊(cè)
刷新評(píng)論列表
只有注冊(cè)用戶
登錄
后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航:
博客園
IT新聞
Chat2DB
C++博客
博問
相關(guān)文章:
java gzip (使用,亂碼問題已解決!)
google proto buffer 使用(java)
tomcat 調(diào)試 擴(kuò)展
一句話 技術(shù) (大家來接龍)
mysql 導(dǎo)出文本數(shù)據(jù)轉(zhuǎn)換展現(xiàn)格式
dwr 學(xué)習(xí)筆記
企業(yè)數(shù)據(jù)分類
logg4j 使用筆記
開源myCompetence權(quán)限框架成立
我的 ssh demo
Powered by:
BlogJava
Copyright © G_G
日歷
<
2008年12月
>
日
一
二
三
四
五
六
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
公告
由于時(shí)間問題,
blog上一些表達(dá)都不太好。
在此我盡量把我參考的原文給大家,
與大家學(xué)習(xí)。^_^
最近在維護(hù)www.aygfsteel.com\Skynet 腳本中
有什么技術(shù)問題不會(huì),
我很愿意和大家討論!
多交流快成長(zhǎng)
liukaiyi@gmail.com
常用鏈接
我的隨筆
我的評(píng)論
我的參與
最新評(píng)論
留言簿
(13)
給我留言
查看公開留言
查看私人留言
隨筆分類
ant(6)
AOP(5)
Database(9)
E_Study(3)
EJB(4)
hibernate(25)
HTML(4)
Inspiration(11)
Jakarta Commons(3)
javaGeneral(28)
javascript(28)
javascript Framework(7)
JDBC(5)
json(3)
JspTag(12)
JUnit(8)
Other(5)
Reportform(3)
Spring(4)
struct(5)
Swing(1)
xml Related(7)
隨筆檔案
2009年4月 (1)
2009年2月 (2)
2009年1月 (1)
2008年12月 (4)
2008年11月 (1)
2008年9月 (7)
2008年8月 (8)
2008年7月 (12)
2008年6月 (9)
2008年5月 (5)
2008年4月 (11)
2008年3月 (6)
2008年1月 (8)
2007年12月 (13)
2007年11月 (13)
2007年10月 (15)
2007年9月 (11)
2007年8月 (9)
2007年7月 (7)
2007年6月 (6)
2007年5月 (3)
2007年4月 (9)
文章檔案
2007年4月 (1)
相冊(cè)
EJB
hbn
ss
wz
hibernate
cjdbc
hibernate.cache
Hibernate中outer-join、lazy 、fetch join關(guān)鍵字的使用
My連接
一個(gè)讀取Gmail郵件的簡(jiǎn)單程序
bat 1%
eXtremeTable limit
java+web
jsp java javascrip 交互
JS函數(shù)集合大全
strut c:
Struts Menu
tree jsp
上手JFreeChart
關(guān)鍵筆記
根據(jù)name調(diào)用getName方法
用JAVA實(shí)現(xiàn)一個(gè)分頁(yè)類
搜索
最新評(píng)論
1.?re: 序列化和反序列化對(duì)象到 數(shù)據(jù)庫(kù)
qwe
--erwqe
2.?re: 部分高級(jí)查詢 sql 拼寫筆記 (mysql)
說實(shí)話,寫的的的確是差了那么一點(diǎn)點(diǎn)
--老衲用飄柔
3.?re: html 簡(jiǎn)單 div 拖動(dòng)
好。
--火星華人
4.?re: hibernate 多服務(wù)器數(shù)據(jù)同步問題(支持延遲同步)
評(píng)論內(nèi)容較長(zhǎng),點(diǎn)擊標(biāo)題查看
--張久強(qiáng)
5.?re: 數(shù)據(jù)庫(kù)表地址數(shù)據(jù)(中國(guó)地區(qū))
謝謝分享,收藏了!
--久久快樂鮮花
閱讀排行榜
1.?google svn 服務(wù)器使用(14267)
2.?mysql 權(quán)限控制筆記(11674)
3.?mysql 游標(biāo)使用(7121)
4.?強(qiáng)大的 ant scp 和 sshexec (6392)
5.?CGLib 學(xué)習(xí)(5786)
評(píng)論排行榜
1.?hibernate 多服務(wù)器數(shù)據(jù)同步問題(支持延遲同步)(12)
2.?部分高級(jí)查詢 sql 拼寫筆記 (mysql)(9)
3.?為在平安夜還在加班的程序員祝福!(8)
4.?原創(chuàng)小框架: 動(dòng)態(tài)面向?qū)ο髷?shù)據(jù)庫(kù)操作(不要影射類哦)(6)
5.?自用小框架:DB工廠(6)
主站蜘蛛池模板:
阜康市
|
滨海县
|
渝北区
|
麟游县
|
阜康市
|
林周县
|
延庆县
|
社会
|
静海县
|
芒康县
|
洞口县
|
青冈县
|
古交市
|
民丰县
|
慈溪市
|
林西县
|
丹棱县
|
尼勒克县
|
祁东县
|
临猗县
|
西平县
|
五家渠市
|
青田县
|
乡城县
|
专栏
|
长宁区
|
金堂县
|
甘孜县
|
墨竹工卡县
|
上犹县
|
永丰县
|
柘城县
|
周宁县
|
成武县
|
青岛市
|
晋城
|
马龙县
|
柘城县
|
玉环县
|
黔南
|
锦屏县
|