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.
HI All, Is there any way we can kill a thread which is reading data with out using stop method(i think Sun is going to depricate this method). which typically could occur when user tries to read a file using java.IO API.
This would generally be done using the interrupt() method. If your thread is blocked on any I/O read/write and its interrupt method is called, a ClosedByInterruptException will be thrown, which you can catch and deal with gracefully in the thread.
You should take a look at the JavaDocs for the Thread class.