This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am trying to download a file using Struts 2 but the downloaded XML file is corrupt. It works if the xml file has around 60 lines else the content is ignored. I am not an IO expert but kindly correctly me if I need to fix anything here. Can someone please help me? Here is what I am trying to do.
The Action class:
And specifically in regard to your post, I think you will find that the utility you mention doesn't make the mistake of assuming the "available()" method will always return the length of the response body.