Author Archive

Copying Files Using NIO

Prior to the JDK 1.4 introduction of the NIO package a tipical file copy routine would look something like: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 public static void copyFile(File in, File out) throws Exception { FileInputStream fis = new FileInputStream(in); FileOutputStream fos = new FileOutputStream(out); [...]

Simplify Unit Testing With Dependency Injection

After you read a bit about dependency injection you might say “So what? There isn’t much of a practical gain” and an the surface I actually agree with you, I mean how many instances are there where we really need to be able to create infinate class permutation without using subclassing? I believe the place [...]

Dependency Injection Basics

Dependency Injection is a process of supplying external dependencies to componenets, changing the flow of control of the system to be inverted in comparison to the traditional architecture of software libraries. Dependency Injection builds of the concept that you should favor composition over inheritance [Effective Java Programming Language Guide, chapter 4, item 14], but extending [...]

Comparison of Continuous Integration Servers

A Short Background Continuous integration is a practice the grew out of the extreme programming community, and was written about by Martin Fowler and Kent Beck. Martin Fowler’s paper provides a very nice definition of the term Continuous Integration is a software development practice where members of a team integrate their work frequently, usually each [...]

Little Endian Input Stream

As everybody probably knows, Java only supports Big Endian streams but every once and a while you find yourself in the predicament of wanting to interface with a legacy system that wants to use little endian encoding. So I’m attaching a class that will allow you to use the nice DataInputStream API but that will [...]