Re: [問題] 有關 imputStream
※ 引述《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
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 3 之 4 篇):