code: private String readToDelimiter() {
          String line = null;
          while(line == null || line.isEmpty()) {
              int delimiterIndex = mBuffer.indexOf(DELIMITER);
              if(delimiterIndex != -1) {
                  line = mBuffer.substring(0, delimiterIndex);
                  mBuffer.delete(0, delimiterIndex + 1);
              } else {
                  line = null;
                  break;
              }
          }
          return line;
      }
docs: Parse the current byte buffer to find the next potential message.
  
  The first potential serialized message data in the buffer is removed and
  returned. Any delimiters at the start of the buffer will be cleared.
  
  @return A potential serialized JSON message or null if none found.