作者TonyQ (骨头)
看板java
标题Re: [问题] 有关 imputStream
时间Thu Apr 5 05:22:02 2007
※ 引述《aaa12345 (一肩担鸡双头啼)》之铭言:
: 有关 FileInputStream a= new FileInputStream(XXXX);
: XXXX的部分是不是不接受url?꜊: 我自己试了一下是不行的
: 但网路上查一下好像有人这样用?
: 可以请高手解释一下吗?
FileInputStream的用法 , 查一下API就知道了,
有写的就是有 没写的除非自己拐个弯实做,不然都是做不到的。
http://java.sun.com/j2se/1.5.0/docs/api/java/io/FileInputStream.html
────────────────────────────────
URL可以用
URL.openConnection()
取得对应的URLConnection
再做 getInputStream 接到 StreamReader(像BufferedReader) 做处理。
这是我觉得比较"正统"的作法。
http://java.sun.com/j2se/1.5.0/docs/api/java/net/URL.html
http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLConnection.html
--
String temp="relax"; | Life just like programing
while(buringlife) String.forgot(temp); | to be right or wrong
while(sleeping) brain.setMemoryOut(); | need not to say
stack.push(life.running); | the compiler will
stack.push(scouting.buck()); | answer your life
stack.push(bowling.practice()); | Bone
everything
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.134.27.68