Two Laptop Bag*
The moose likes Java in General and the fly likes about URL access (Please help me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "about URL access (Please help me" Watch "about URL access (Please help me" New topic
Author

about URL access (Please help me

alanchang
Greenhorn

Joined: Oct 18, 2001
Posts: 1
why can't display BIG5 character
my code is -->
import java.net.*;
import java.io.*;
//import java.io.InputStreamReader;
//import java.io.OuputStreamReader;
/*
BufferedReader in =new BufferedReader(new FileReader("IOStreamDemo.java"));
String s, s2 = new String();
while((s = in.readLine())!= null)
s2 += s + "\n";
in.close();
*/
class OpenStreamTest {
public static void main(String[] args)
{
try {
URL yahoo = new URL("http://tisv.tpis.nat.gov.tw/Exchange/PARKX01/park.csv");
DataInputStream dis =new DataInputStream(yahoo.openStream());
String inputLine;
BufferedWriter kow=new BufferedWriter(new FileWriter("C:/ko24_6.out"));
while((inputLine = dis.readLine())!=null)
{
//�g�J������
inputLine=inputLine+"\n";
System.out.println(inputLine);
String line;
kow.write(inputLine,0,inputLine.length());
//kow.flush();
//�q�������X
BufferedReader kor=new BufferedReader(new FileReader("C:/ko24_6.out"));
line=kor.readLine();
System.out.println(line);
}
kow.flush();
dis.close();

}catch(MalformedURLException me){
System.out.println("MalformedURLException:"+me);

}catch(IOException ioe){
System.out.println("IOException:"+ ioe);
}

}
}
<-- my code
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

Hi Alan -
Please take a look at JavaRanch's naming policy. To maintain a professional appearance, we ask that you register with first and last names separated by a space. The site supports that just fine.
Also, you can use HTML or UBB markups to format your code. This not only makes your source far easier to read, it's likely more people will look at it close enough to see problems.
Welcome to JavaRanch!


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
 
jQuery in Action, 2nd edition
 
subject: about URL access (Please help me
 
Similar Threads
Holy SPANK!! I got a connection...
find multiple occurences of string in file
Write bufferedreader to a file
different behaviour in writing to a file
can i get other website contents in my webapplication