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...

Count Author Group Country
(2) erani Administrators Moldavia
(1) wyk Administrators Moldavia
Page 1/1    
Page created in 0.095 seconds