All weblogs of our users. Current weblogs count: 2. During the past week created or updated pages count: 0.
| Random pick author: erani | Title: Java: get a file from URL | Updated: 2009-08-12 |
The following code show how to get a file from URL
Code:
URL serviceUrl = new URL("http://www.hoax-slayer.com/images/north-pole-moon2.jpg");
URLConnection urlConn = serviceUrl.openConnection();
InputStream is = serviceUrl.openStream();
FileOutputStream fos = new FileOutputStream("/tmp/myfile.tmp");
int aChar;
while ((aChar = is.read()) != -1) {
fos.write(aChar);
}
...
More...
URLConnection urlConn = serviceUrl.openConnection();
InputStream is = serviceUrl.openStream();
FileOutputStream fos = new FileOutputStream("/tmp/myfile.tmp");
int aChar;
while ((aChar = is.read()) != -1) {
fos.write(aChar);
}
...
More...
Count |
Author |
Group | Country |
|
|
erani | Administrators | Moldavia |
|
|
wyk | Administrators | Moldavia |
Page 1/1


