public static void jdkFetch(String address) {
try {
URL url = new URL(address);
URLConnection connection = url.openConnection();
BufferedReader in = new BufferedReader(
new InputStreamReader(connection.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) {
System.out.println(inputLine);
}
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}


0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.