alvin's blog

Java URL example - Download the contents of a URL

Java URL download FAQ: How can I download the contents of a URL using Java?

Note: It's 2013 now and this code is a little old, but hopefully it will still get you pointed in the right direction.

In some Java applications you'll want to download the contents of a URL across a network. For example, I've written two applications that do this regularly.

Java Runtime class - Invoke the Java garbage collector

Note: This article is very old, like 1990s-old. In the 90s we did things like this, but manually manipulating theJava garbage collector in the 201x years is not a best-practice. That being said, I'm leaving this article here for historical reasons.

Summary: This article demonstrates how to use the Java Runtime class to invoke the Java garbage collector, and shows the results of running the Java Runtime freeMemory method in an example class.

Java performance tuning - put timers in code to benchmark performance

With a programming language/environment such as Java the performance of our Java code may be a concern. I often use an old-fashioned "quick-and-dirty" way to measure the performance of Java code, and I'll share that method in this brief article.

An old-fashioned manual method

I must confess, the method I use is as old-fashioned as they come. Generally it requires three steps:

A Java applet sound example

We all know that multimedia, used properly, can make any web site more entertaining. In this applet tutorial, we'll present a brief example of a Java applet that plays a sound file when it is downloaded. The compiled applet class file is very small - only 559 bytes - and can be downloaded quickly into a user's web browser.

Linux tutorial, part 1

I thought I'd take a little time and write a tutorial on how to get started with the Linux, Unix, and Mac OS X operating systems. As I write this I'm trying to keep in mind a friend of mine who works strictly on Windows, so I'm writing this from that perspective.

Here then is my "Getting Started with Linux and Unix" tutorial.

Syndicate content