13.07.2015 Views

Java – programowanie sieciowe - Koszalin

Java – programowanie sieciowe - Koszalin

Java – programowanie sieciowe - Koszalin

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Czytanie z obiektu URLMetoda InputStream openStream () klasy URL potrafinawiązać połączenie z podanym zasobem w sieci i otworzyćdla niego strumień do czytania:URL url = new URL(URLName);BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));String line;while ((line=in.readLine())!=null){// kolejne linie dokumentu są do dyspozycji}in.close();

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!