Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Does BufferedReader act like a buffer ?  RSS feed

Tony Combe
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know this may well sound like a stupid question but if I use BufferedReader's readLine() method to read a socket and the thread thats deals with reading the socket is doing some other process whilst a communication comes over that socket will the communication be stored in BufferedReader until I call readLine() again or will it be lost. And to ask another stupid question if it does act as a Buffer (as the name suggests) then how much info will it contain before it gets filled up, also I've read that when using the readLine() method the method looks for the characters that mean end of line like "\n" but if the strings sent to the socket do not contain any of these characters and the readLine() method is not called before several strings have been recieved will the strings be returned all in one go as they have no character denoting the end of a line.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!