oss_src/sframe/spark_unity.cpp
bool read_msg(std::string& buffer) {
  const int msgLen = read_int();
  //std::cerr << "Reading message of length: " << msgLen << std::endl;
  if (msgLen >= 0) {
    // Resize the buffer and fill it with data  
    buffer.resize(msgLen);
    std::cin.read(&buffer[0], msgLen);
    if (!std::cin.good()) {
      log_and_throw("Fail reading from standard input");
    }
    return true;
  }
  return false;
}
/**
 * Read a message into buffer and return true if successful or 
 * false if end of stream.
 *
 * Note the buffer is automatically resized to store the exact length
 * of the message
 */
Read a message into buffer and return true if successful or
false if end of stream.

Note the buffer is automatically resized to store the exact length
of the message
Read a message into buffer and return true if successful or false if end of stream . Note the buffer is automatically resized to store the exact length of the message
bool read_msg(std::string& buffer) {
  const int msgLen = read_int();
  if (msgLen >= 0) {
    buffer.resize(msgLen);
    std::cin.read(&buffer[0], msgLen);
    if (!std::cin.good()) {
      log_and_throw("Fail reading from standard input");
    }
    return true;
  }
  return false;
}
bool read_msg ( std :: string & buffer ) { const int msgLen = read_int ( ) ; if ( msgLen >= 0 ) { buffer . resize ( msgLen ) ; std :: cin . read ( & buffer [ 0 ] , msgLen ) ; if ( ! std :: cin . good ( ) ) { log_and_throw ( " " ) ; } return true ; } return false ; }
Read a message into buffer and return true if successful or
 false if end of stream.
Read a message into buffer and return true if successful or false if end of stream .
//std::cerr << "Reading message of length: " << msgLen << std::endl; // Resize the buffer and fill it with data  