Question on the flush method

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JnlSeb

    Question on the flush method

    According to Sun's web site, the flush method of the OutputStream object
    does nothing.

    So, what does actually happens when you call it?
    At times I may see different behavior when including it within a program
    (some times a socket read error) which I would think is strange esspecially
    if the method is not supposed to do anything.

    Any ideas?


  • Schenaerts Michaël

    #2
    Re: Question on the flush method

    some subClasses may used it (FilterOutputSt ream)

    On Tue, 16 Sep 2003 12:06:17 GMT, JnlSeb <jnlseb@earthli nk.net> wrote:
    [color=blue]
    > According to Sun's web site, the flush method of the OutputStream object
    > does nothing.
    >
    > So, what does actually happens when you call it?
    > At times I may see different behavior when including it within a program
    > (some times a socket read error) which I would think is strange
    > esspecially
    > if the method is not supposed to do anything.
    >
    > Any ideas?
    >
    >[/color]



    --
    Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

    Comment

    • Phil...

      #3
      Re: Question on the flush method

      In general a flush method is used to force
      data (if there is any) from buffers to a file or device.

      "JnlSeb" <jnlseb@earthli nk.net> wrote in message
      news:Z0D9b.5726 $BS5.715@newsre ad4.news.pas.ea rthlink.net...[color=blue]
      > According to Sun's web site, the flush method of the OutputStream object
      > does nothing.
      >
      > So, what does actually happens when you call it?
      > At times I may see different behavior when including it within a program
      > (some times a socket read error) which I would think is strange[/color]
      esspecially[color=blue]
      > if the method is not supposed to do anything.
      >
      > Any ideas?
      >
      >[/color]


      Comment

      • Alexander Bryanson

        #4
        Re: Question on the flush method



        JnlSeb wrote:
        [color=blue]
        > According to Sun's web site, the flush method of the OutputStream object
        > does nothing.
        >
        > So, what does actually happens when you call it?
        > At times I may see different behavior when including it within a program
        > (some times a socket read error) which I would think is strange esspecially
        > if the method is not supposed to do anything.
        >
        > Any ideas?
        >
        >[/color]

        I'd hate to sound pedantic, but none of the methods of OutputStream do
        anything, since OutputStream is an interface. They're just guidelines.

        In theory, I could write an implementation of OutputStream that did
        complex math, but, what would the point be? Besides, complex math makes
        my head hurt. >_<

        Comment

        Working...