Is there a way to flush the input stream in Java, perhaps prior to closing it? In relation to
iteratively invoking the statements below, while reading several files on disk
InputStream fileStream = item.openStream();
fileStream.close;
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.
InputStreamcannot be flushed. Why do you want to do this?OutputStreamcan be flushed as it implements the interfaceFlushable. Flushing makes IMHO only sense in scenarios where data is written (to force a write of buffered data). Please see the documentation ofFlushablefor all implementing classes.