Originally posted by Mat Cauthon:
I wonder why HF Java uses BufferedReader and Printwriter and doesn't mention these issues.
edit: I tried fixing the second example, but it still blocks. Could you show me a small amount of code that will not block, please?
Lets say I am writing an FTP server in Java, should there be any major issues I need to know up front when I don't know the platform that clients will be using?
Did you change both instances of write.print? You had one on the server and one on the client.
Unlike the PrintStream class, if automatic flushing is enabled it will be done only when one of the println() methods is invoked, rather than whenever a newline character happens to be output...
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Originally posted by Mat Cauthon:
I use printwriter all the time for writing to files, and have never had this issue.
What is your opinion about DataOutputstream vs PrintWriter? Does one have any specific advantages or disadvantages, other then my frusterations already vented here?
expectation is the root of all heartache - shakespeare. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|