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

  • SEARCH
  • Home
  • 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 6839813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:45:53+00:00 2026-05-26T23:45:53+00:00

I know the general idea but I’m just not sure if it has an

  • 0

I know the general idea but I’m just not sure if it has an effect since the Android api states following: “Flushes this stream. Implementations of this method should ensure that any buffered data is written out. This implementation does nothing.”

This implementation does nothing <– does that mean its useless to do or am I missing something?

  • 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-05-26T23:45:54+00:00Added an answer on May 26, 2026 at 11:45 pm

    If you read extended docs on oracle

    http://download.oracle.com/javase/1.4.2/docs/api/java/io/OutputStream.html#flush()

    Flushes this output stream and forces any buffered output bytes to be written out. The general contract of flush is that calling it is an indication that, if any bytes previously written have been buffered by the implementation of the output stream, such bytes should immediately be written to their intended destination.

    The flush method of OutputStream does nothing.

    Means, the method itself does nothing, and it is abstract, so any underlying Class can implement its own version of flushing streams and forcing them to write (not waiting in write queue)

    But anyway, as Guillaume pointed out, it’s good practice to call it anyway. If later on, you replace your stream with another implementation that does use it, then you’ll be sorry.

    Depending on the OS, flush() does nothing more than force the data to be written to the OS.

    and

    flush() does nothing on FileOutputStream. It is only useful on buffered streams.

    and from javadoc of close(), just to note you don’t have to flush stream if you’re closing it immediately after.

    Close the stream, flushing it first. Once a stream has been closed, further write() or flush() invocations will cause an IOException to be thrown. Closing a previously-closed stream, however, has no effect.

    related:
    FileOutputStream.close is really slow when writing large file
    flush in java.io.FileWriter

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

Sidebar

Related Questions

i just want to know a general information about this particular information. Any good
I know it is a general question but I need your recommodations about a
I know, the general answer will be yes, but here is my situation. I
I know this SO question, but it deals with the subject in more general
So, I know that the general idea in PHP is that the whole application
I have a general idea of what an AST is, but I want to
I have what I think is an incredible idea, but I don't really know
I'm looking for a general idea. I know how IEEE float or double is
I am just trying to get a general idea about the event prcessing mechanism
Well, I know it's more of dart-in-the-air type quesiton, but I am just trying

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.