保存网络图片到手机上

// 保存图片到手机端
public static boolean saveNetImage(String url, String destPath)
{
	try
	{
		FileOutputStream fos = new FileOutputStream(destPath);
		InputStream is = new URL(url).openStream();

		int data = is.read();
		while (data != -1)
		{
			fos.write(data);
			data = is.read();
		}
		is.close();
		fos.close();
		
		return true;

	} catch (IOException e)
	{
		e.printStackTrace();
		return false;
	}
}

你可能感兴趣的:(网络图片,保存网络图片到手机,保存网络图片)