I want to make a program in java in which one thread is reading a file and other is writing in
it. Anybody please provide me any reference link where I can find the code snippets for the
same?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You shouldn’t read and write to a file at the same time. In the best case, you’ll end up with corrupted data, or an IO error.
If it’s for inter-process communication, you should instead use sockets or higher-level systems like JMS.