Surprising outrageous file handling

I don’t usually focus on bad examples of code (because there are so many ways to do it wrong they are rarely repeated) but here I found a particular pattern that was pernicious and repeated all through the code, indicating that at least one development thought this was a really good idea.  It isn’t. Continue reading

3 reasons that XML should be Streamed and never “Stringed”

XML is a text format, and so it is tempting to handle it with the normal String handling capabilities of Java, but there are several reasons that you must never do this.  XML should either be on the disk as a sequence of bytes, or it should be parsed as a DOM tree of decoded string values, but it should never be in a String in its encoded value. Continue reading