由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - applet如何从jar:file:或者jar:http:读入文件
相关主题
Java Resource一问Java笔试题分享-Networking
Applet读取加密的文件一个问题java applet读网络文件的问题
java applet启动花很多时间怎么回事?generics这样改对马?
Re: access host file in appletRe: How to write to a file on server in an applet?
Re: 关于APPLET的IO问题a question regarding applet
Authenticated Applet Doesn't Show in VBApp赶快帮帮我!
Re: Display, edit, and save Image on HTM再问个java的蠢问题,别骂我
问java applet的问题愣是笨到家----整不明白applet的path
相关话题的讨论汇总
话题: url话题: jar话题: zipentry
进入Java版参与讨论
1 (共1页)
b***i
发帖数: 3043
1
网上有一个从本地用ZipFile读的,但是我要applet,就不知道怎么做了。
那个网页说用JarURLConnection,也用了,具体到了读入就读入了-1,大侠帮帮妈忙?
URL url0 = baseClass.class.getResource(jarFileName);
String ok = "jar:file:"+ url0.getPath()+"!/"+name; // name is file name
inside
URL url=new URL(ok);
JarURLConnection conn = (JarURLConnection)url.openConnection();
ZipEntry ze=(ZipEntry)conn.getJarEntry();
int size=(int)ze.getSize();
InputStream fis= conn.getInputStream();
BufferedInputStream bis=new BufferedInputStream(fis);
ZipInputStream zis=new ZipInpu
1 (共1页)
进入Java版参与讨论
相关主题
愣是笨到家----整不明白applet的pathRe: 关于APPLET的IO问题
为什么我这个html找不到applet class?Authenticated Applet Doesn't Show in VBApp
Core Java2 Notes (2)Re: Display, edit, and save Image on HTM
How do a Servlet sent a Applet?问java applet的问题
Java Resource一问Java笔试题分享-Networking
Applet读取加密的文件一个问题java applet读网络文件的问题
java applet启动花很多时间怎么回事?generics这样改对马?
Re: access host file in appletRe: How to write to a file on server in an applet?
相关话题的讨论汇总
话题: url话题: jar话题: zipentry