• Post Reply Bookmark Topic Watch Topic
  • New Topic

Making a simple client server program without readline  RSS feed

 
Chet Arora
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Im trying to create a simple client application and a simple server application. I dont want to use readLine in any of the applications as
readLine requries the newline character be present at the end of every message. What are the best classes/methods to follow for an approach without using the newline character ?
Thanks,
Chetan
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use ObjectOutputStream and ObjectInputStream. They will serialize Objects and arrays across a socket and there's no need to worry about newlines.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!