Discussion on:

7
Comments

Join the conversation!

Follow via:
RSS
Email Alert
0 Votes
+ -
Is it necessary to flush the stream before closing it?
0 Votes
+ -
Yes and no
Jeff Hanson 19th Apr 2002
The flush() method writes out any buffered data to the physical stream. However, the close() method will flush any buffers as well. The decision flush or not depends on the individual application. If the physical device is known and repeated writesto the device will result in a dramatic decrease in performance, it may be a good idea to wait and only flush periodically. However, if it is vital that the data be written to the physical device with each call, then it is probably a good idea to flush.
While readers and writers are convenient, it is much more efficient to use the stream classes to read and write data. The stream classes are closer to the native/physical data source.
0 Votes
+ -
Really?
anotherphd 30th Apr 2002
I have a hard time agreeing with you. The buffered readers and writers are direct optimizations on the stream classes. It is hard to believe that they are not more efficient.
0 Votes
+ -
Not quite!
gnosnah 30th Apr 2002
The whole idea behind the buffered classes is to optimize the stream.
0 Votes
+ -
I understand that for more advance Java advocates that the extra code would be tedious and not nessesary, but for some of us Java newbies, complete source to build, run, and to know what to import would be very nice...

As it is now there are straight examples, which are nice, but I dont know what package to include and would like to see the code working.

Not all of it has to be complete but the last big one should of been complete....

later
can someone help me read data from writable datasource to java methods.
Keyboard Shortcuts:
Prev
Next
Toggle
Join the conversation
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.