Results 1 to 7 of 7
  1. #1
    Ozmosis is offline Member
    Join Date
    Oct 2009
    Posts
    9
    Rep Power
    0

    Default problem with BufferedReader

    i have encountered a problem, i used BufferedReader to accept data coming from a socket connection, and the problem is that i sent an array of strings bt the methods that are included with BufferedReader (readLine()) returns a string only. so any suggestions????

  2. #2
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    10

    Default

    How did you send the array of strings?

  3. #3
    Ozmosis is offline Member
    Join Date
    Oct 2009
    Posts
    9
    Rep Power
    0

    Default

    i used write from PrintWriter but it takes a string, although i made my method takes an array of strings n then pass it to the write method, however no problem was produced during compilation. didnt test the receiving side because of the problem stated above.

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    10

    Default

    So you didn't write an array of strings at all did you? Just the toString of an array of strings.

  5. #5
    Ozmosis is offline Member
    Join Date
    Oct 2009
    Posts
    9
    Rep Power
    0

    Default

    i guess tht wat happend , i cant be sure coz i didnt tested it as i said bt i didnt programmed to do that bt probably i did it automattically (change the string array to string).

    any ways do u have any solution for both sending and receiving an array of string through a socket???

  6. #6
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    10

    Default

    Try using ObjectOutputStream to write the array as an object.

  7. #7
    Ozmosis is offline Member
    Join Date
    Oct 2009
    Posts
    9
    Rep Power
    0

Similar Threads

  1. How to use BufferedReader?
    By ProgramBeginner in forum New To Java
    Replies: 4
    Last Post: 10-11-2011, 02:56 PM
  2. how can i make bufferedreader
    By chyeeqi in forum New To Java
    Replies: 4
    Last Post: 08-21-2009, 05:24 PM
  3. BufferedReader
    By vidhya.sk in forum New To Java
    Replies: 2
    Last Post: 09-18-2008, 01:57 PM
  4. Replies: 1
    Last Post: 01-15-2008, 09:55 PM
  5. BufferedReader empty
    By Peter in forum Advanced Java
    Replies: 2
    Last Post: 07-02-2007, 06:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •