파일 스트림
-
웹에 존재하는 파일 Stream을 이용해서 다운로드 하기안드로이드/개발 팁 2011. 2. 18. 23:06
String src="http://192.168.1.106/football.3gp"; String des="sdcard/temp1357.3gp"; InputStream in = null; OutputStream out = null; try{ in = new BufferedInputStream(new URL(src).openStream()); out = new BufferedOutputStream(new FileOutputStream(des)); int read; while(true){ read = in.read(); if(read == -1) break; out.write(read); } in.close(); out.close(); finish(); } catch (FileNotFoundException..