Please post code in the form of an
SSCCE- this code does not contain the lines you're talking about, so it's pretty hard to answer your question.
My guess would be that both streams are compared to null in case there was an Exception while attempting to create them. If they weren't created, you can't close them.
They're initially set to null so that this comparison can happen in the first place. Java doesn't assign null to variables inside functions, so you have to specifically tell it to set the variable to null. If you didn't do that, this code wouldn't work - in fact you'd probably get a compilation error.
But like I said, without an SSCCE, I'm just guessing.