• Post Reply Bookmark Topic Watch Topic
  • New Topic

BufferedOutputStream  RSS feed

 
pappu java
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using a Server and a client program to communicate using sockets.Whenever I write data to a BufferedOutputStream in the server it never appears at the client .Flushing the bufferedoutputStream dosen't work.
I get data at the client only if i use a big loop to continuosly write to the bufferedoutputstream.
 
MSanjeevMehra
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry dear, i am not able to ans. ur question. but ur display name is not according to naming policy of javaranch. so visit the foolowing link
naming policy
and also u r no allowed to post multiple thread of same ques. so pls. correct ur display name. well u will get a mail from moderaters of this forum also.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sanjeev,
Note that your display name is a violation of the naming policy as well! You need both first and last names, with a space between.
Otherwise, thanks for pitching in! See you around the Ranch!
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the IO and Streams forum...
 
Parag Patil
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using PrintWriter instead on BufferedOutputStream and the println method instead of write works very well but the autoflush option must be enabled while creating a PrintWriter Object.
Also using print (instead of println) dosen't work because println inserts a line separator string ( "/n" : system dependant) at the end of user entered string which is required for autoflushing
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!