I'm not familiar with the ContextInitializer interface you refer to, but based on the exception you're getting my first reaction is that no, you can't call getServletContext inside the contextInitialized method. If you check out http://www.docjar.com/html/api/javax/servlet/GenericServlet.java.html, you'll see that, at line 160, it's trying to get the context from the ServletConfig, and apparently the ServletConfig object for that servlet isn't initialized yet.
Your best bet (in my opinion) would be to execute the code you're wanting to run at a point where both ServletConfig and ServletContext are initialized -- since I'm not familiar with what environment you're working with (like I said, I'm not familiar with ContextInitializer, so I don't know where that came from), I can't really help too much as far as your servlet life cycle goes.
Depending on what exactly you're trying to do, you may consider having your input stream as a static field. Inside your doGet/doPost method, you'd check to see if it's been initialized -- if it has, then great, carry on as normal; and if it hasn't, then initialize it as necessary. Your context and config should be available in doGet/doPost, so you should be good to go.