java - InputStreamReader's read() method doesn't return anything -


i'm java , android developer. work software update application , use ftp4j project ftp library have problem. when connection's speed low @ end of download while getting ftp reply there strange issue. in codes @ bottom "int = reader.read()" doesn't return codes doesnt continue run. checked whether reader ready or not returns true when issue occurs. how can fix issue? helpless now. here codes:

public string readline() throws ioexception {     stringbuffer buffer = new stringbuffer();     int previous = -1;     int current = -1;     {         int = reader.read();         if (i == -1) {             if (buffer.length() == 0) {                 return null;             } else {                 return buffer.tostring();             }         }         previous = current;         current = i;         if (/* previous == '\r' && */current == '\n') {             // end of line.             return buffer.tostring();         } else if (previous == '\r' && current == 0) {             // literal new line.             buffer.append(system_line_separator);         } else if (current != 0 && current != '\r') {             buffer.append((char) current);         }     } while (true); } 

p.s : reader inputstreamreader.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -