Results 1 to 4 of 4
Thread: Reading Chunks of Data
- 03-22-2010, 04:24 AM #1
Member
- Join Date
- Mar 2010
- Posts
- 6
- Rep Power
- 0
Reading Chunks of Data
I am trying to implement a calculator protocol over a server and I have setted up a client and a server. The client will be sending data to the client such as "CALC ver3 \nValue 54.6" and "OPER ver3 \nOperation: ADD". I am trying to find for the server to read the data while ignoring the \n. At the moment, I have a BufferedReader set up, and I am using the readLine() method to process the input. The problem here is that readLine() considers a line to terminate when it sees the \n which is not what I want. Are there any alternatives to solve my problem?
- 03-22-2010, 08:19 AM #2
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
Uhm, maybe you should not be using a new line there, or you should simply always read two lines as long as the first line coincides with your "protocol"?
- 03-22-2010, 08:22 AM #3
Member
- Join Date
- Mar 2010
- Posts
- 6
- Rep Power
- 0
The protocol states that there must be a new line there.
How would I read two lines at a time instead of one? I am looking through BufferedReader and it seems that my only options are to read one line at a time, or one character at a time.
- 03-22-2010, 08:42 AM #4
Senior Member
- Join Date
- Jun 2008
- Posts
- 2,366
- Rep Power
- 7
Similar Threads
-
Reading Numerical Data
By tyang in forum New To JavaReplies: 1Last Post: 02-05-2010, 03:19 AM -
problem with reading excel sheet data reading using poi libraries
By sandeepsai17 in forum New To JavaReplies: 5Last Post: 08-21-2009, 11:03 AM -
Reading data to file
By puk284 in forum Advanced JavaReplies: 1Last Post: 04-28-2009, 03:19 PM -
continuous playback of chunks
By arnab321 in forum CLDC and MIDPReplies: 0Last Post: 12-11-2008, 08:46 PM -
Reading Data from a file
By ramachandran in forum New To JavaReplies: 2Last Post: 10-24-2007, 07:22 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks