Exemplo n.º 1
0
  private String readLine() throws IOException {
    StringBuilder sb = new StringBuilder();
    int d;
    while ((d = mIn.read()) != -1) {
      if (((char) d) == '\r') {
        continue;
      } else if (((char) d) == '\n') {
        break;
      } else {
        sb.append((char) d);
      }
    }
    String ret = sb.toString();
    if (K9.DEBUG && K9.DEBUG_PROTOCOL_SMTP) Log.d(K9.LOG_TAG, "SMTP <<< " + ret);

    return ret;
  }
 private String readLine() throws IOException {
   StringBuilder sb = new StringBuilder();
   int d = mIn.read();
   if (d == -1) {
     throw new IOException("End of stream reached while trying to read line.");
   }
   do {
     if (((char) d) == '\r') {
       continue;
     } else if (((char) d) == '\n') {
       break;
     } else {
       sb.append((char) d);
     }
   } while ((d = mIn.read()) != -1);
   String ret = sb.toString();
   if (K9MailLib.isDebug() && DEBUG_PROTOCOL_POP3) {
     Log.d(LOG_TAG, "<<< " + ret);
   }
   return ret;
 }