Uncategorized

Look Mom, No Typing

Always wanted to leave a comment about something you’ve read on my site, but couldn’t be bothered to type a response. Well now you can using my new Google Voice Call widget. Now you don’t have to worry about carpel tunnel or any of that fancy spelling stuff. Really all you need is a mouth [...]

Ignore Compiler Warnings

Let me be upfront, I will be the first person to tell you that you should treat a warning as if it were an error. The compiler is trying to tell you something, it wants to help you. The very smart people who are designing our compiler aren’t identifying code patterns and exposing them as [...]

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); [...]

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 [...]

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 [...]