Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7867947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T00:50:43+00:00 2026-06-03T00:50:43+00:00

I just read that Some buffered output classes support autoflush, specified by an optional

  • 0

I just read that

Some buffered output classes support autoflush, specified by an
optional constructor argument. When autoflush is enabled, certain key
events cause the buffer to be flushed. For example, an autoflush
PrintWriter object flushes the buffer on every invocation of println
or format.

So if I am keeping the reference of any BufferReader for some time being and it gets flushed , then how all the data will be retained back? Is there some call back mechanism that will automatically flush it and again read the content or will I lose the data and again I need to call for it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T00:50:45+00:00Added an answer on June 3, 2026 at 12:50 am

    So if I am keeping the reference of any BufferReader for some time being and it gets flushed , then how all the data will be retained back?

    I think you mean BufferedWriter. (Neither the Reader or InputStream APIs have a flush() method. Flushing doesn’t make any sense on a “source”.)

    The flushed data is written to the stream’s “sink”; i.e. the file or socket or whatever. So if you look in the file (or whatever), the data will be there if the stream has been flushed (successfully).

    Is there some call back mechanism that will automatically flush it and again read the content

    There is no callback mechanism1. (At least, not in any of the buffered stream classes that the standard class library provides: who knows what a custom class might do …)

    Data is flushed automatically when certain things happen. For example, when the application calls println … for a PrintWriter.

    … or will I lose the data and again I need to call for it?

    This doesn’t make sense, either grammatically or semantically. I don’t know what you are trying to ask.

    Perhaps you don’t understand what flushing does. Flushing simply means pushing the data out of the buffers and out to wherever the stream sends its data. An explicit flush() call or an automatic flush just means “write it NOW”.


    1 – Incidentally, BufferedWriter doesn’t have a finalize() method either. This means that if one of these objects becomes unreachable while it still has output buffered, that output will never be written.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just read some related questions that came up when I typed the subject,
Just read some posts about how wonderful Silverlight 3.0 is, including that it uses
I just read that C99 has double_t which should be at least as wide
I am new to Java. I just read that class variables in Java have
I just read an article that explains the zero-copy mechanism. It talks about the
I've just read an article that supposedly introduced me to a new concept: Up
I've just read in a file that is something like: name: john, jane car:
I just read Factory Method. I understand that it provides a way to delegate
I just read about DNS protocol, and found, that the name field can be
I am still a C++ newbie. Just came to read that the static member

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.