How can I resize the image that was retrieved via URL and save it?
<p>I am getting an image via URL from the Internet and trying to resize (to a smaller size) before saving it. I managed to save it, but I'm unable to resize it. How could I do that? Here is the code:</p>

<pre><code>URL url = new URL(LogoURL);

InputStream input = url.openStream();
try {
    OutputStream output = new FileOutputStream("data/data/com.android.mylogo/logo.jpg");
    try {
        //byte[] buffer = new byte[aReasonableSize];     
        int bytesRead = 0;
        System.out.println("Buffer Length is \t:-" + buffer.length);
        while ((bytesRead = input.read(buffer, 0, buffer.length)) &gt;= 0) {
            System.out.println("inside while");
            output.write(buffer, 0, bytesRead);
        }
    } finally {
        output.close();
        System.out.println("saved image");
    }
} finally {
    input.close();
}
</code></pre>
