Results 1 to 2 of 2
  1. #1
    fexadyn is offline Member
    Join Date
    Oct 2009
    Rep Power

    Default readline() doesnt read whole line, are there another terminating characters ?

    i constructed socket communication between java(receiver) and c++(sender) machines. i want to send image as char array c++ to java. by using opencv library, i can read image file on system and convert it to rgb char array. but for some images, taken from cam and converted after bmp, i can't send them. in java side readline() method couldnt read all the line. can be there any terminatying characters in the image file ? or how can i fix this ?

    is there another reading method which i can read only i.e first 270000 characters from socket ?

  2. #2
    mrmatt1111's Avatar
    mrmatt1111 is offline Senior Member
    Join Date
    Aug 2009
    San Jose, CA, USA
    Rep Power


    With readline() it is looking for a '\n' character to determine the end of a line. That works fine for strings and things that can be turned into strings, like numbers and such, but if you send over binary data, that binary data will contain the character '\n' as part of it's normal values.
    My Hobby Project: LegacyClone

Similar Threads

  1. [SOLVED] read last line
    By Azndaddy in forum New To Java
    Replies: 22
    Last Post: 04-22-2012, 09:22 PM
  2. Replies: 4
    Last Post: 09-10-2009, 10:18 AM
  3. How to make Scanner read the same line
    By mcollins in forum New To Java
    Replies: 2
    Last Post: 03-03-2009, 06:41 AM
  4. Replies: 0
    Last Post: 06-25-2008, 10:35 AM
  5. read the file from different line number
    By vaskarbasak in forum Advanced Java
    Replies: 3
    Last Post: 06-02-2008, 01:31 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