Returns the text from {@code in} until the next "\r\n", or null if
{@code in} is exhausted.
439902
private String readAsciiUntilCrlf(InputStream in) throws IOException {
        StringBuilder builder = new StringBuilder();
        while (true) {
            int c = in.read();
            if (c == '\n' && builder.length() > 0 && builder.charAt(builder.length() - 1) == '\r') {
                builder.deleteCharAt(builder.length() - 1);
                return builder.toString();
            } else if (c == -1) {
                return builder.toString();
            } else {
                builder.append((char) c);
            }
        }
    }
293271
public String getTexTextValue() {
		String text = value;
		if ((text != null) && (text.trim().length() > 0)) {
			Enumeration e = bundle.getKeys();
			while (e.hasMoreElements()) {
				String key = (String) e.nextElement();
				if (text.indexOf(key) != -1)
					text = stringReplace(text, key, bundle.getString(key));
			}
		}
		return text;
	}
220228
protected static String grep(String selector, String text) {
		if (text == null || text.isEmpty()) {
			return null;
		}
		final StringBuilder line = new StringBuilder();
		final int textLength = text.length();
		char c;
		String string;
		for (int i = 0; i < textLength; ++i) {
			c = text.charAt(i);
			if (c == '\n' || c == '\r') {
				string = line.toString();
				if (string.contains(selector)) {
					return string;
				}
				line.setLength(0);
			} else {
				line.append(c);
			}
		}
		if (line.length() > 0) {
			string = line.toString();
			if (string.contains(selector)) {
				return string;
			}
		}
		return null;
	}
1150304
public String getText()
    {
        String strText = super.getText();
        if (strText != null)
            if (strText.equals(m_strDescription))
                strText = Constants.BLANK;
        return strText;
    }
516240
static String getNextCommaToken(String inString) {
        String token = "";

        //number of open parenthesis
        int parenthesis = 0;

        for (int i = 0; i < inString.length(); i++) {

            if (OPEN_PARENTHESIS == inString.charAt(i)) {
                parenthesis++;
                token += inString.charAt(i);

            } else if (CLOSE_PARENTHESIS == inString.charAt(i)) {
                parenthesis--;
                token += inString.charAt(i);
            } else if (COMMA == inString.charAt(i)) {
                //if there is no open parenthesis finish
                if (parenthesis == 0) {
                    break;
                } else {
                    token += inString.charAt(i);
                }
            } else {
                token += inString.charAt(i);
            }

        }

        return token;

    }
780327
function(inText) {
			return inText != null ? String(inText).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;') : '';
		}
108424
@Override
  public String getNext() {
    try {
      int nextTok = st.nextToken();
      switch (nextTok) {
        case java.io.StreamTokenizer.TT_EOL:
          return eolString;
        case java.io.StreamTokenizer.TT_EOF:
          return null;
        case java.io.StreamTokenizer.TT_WORD:
          return st.sval;
        case java.io.StreamTokenizer.TT_NUMBER:
          return Double.toString(st.nval);
        default:
          char[] t = { (char) nextTok };    // (array initialization)
          return new String(t);
      }
    } catch (IOException ioe) {
      // do nothing, return null
      return null;
    }
  }
315011
private String readContent(java.io.InputStream in) throws Exception {

        StringBuffer resultBuffer = new StringBuffer();
        SAXReader reader = new SAXReader();
        Document doc = reader.read(in);
        List<Node> textlist = CmsXmlGenericWrapper.selectNodes(doc, "//text:p[@*] | //text:span[@*]");
        Iterator<Node> li = textlist.iterator();
        while (li.hasNext()) {
            Node textNode = li.next();
            String text = textNode.getText();
            if (text.length() > 1) {
                text = " " + text + " ";
                resultBuffer.append(text);
            }
        }
        return resultBuffer.toString();
    }
990187
@Deprecated
    public char next()
    {
        if (pos < end - 1) {
            pos++;
            return text.charAt(pos);
        }
        else {
            pos = end;
            return DONE;
        }
    }
479662
private static String unescapeLiteral(final String text) {

        if (text == null) {
            return null;
        }

        StringBuilder strBuilder = null;

        final int max = text.length();

        int readOffset = 0;
        int referenceOffset = 0;

        char c;

        for (int i = 0; i < max; i++) {

            c = text.charAt(i);

            /*
             * Check the need for an unescape operation at this point
             */

            if (c != ESCAPE_PREFIX || (i + 1) >= max) {
                continue;
            }

            if (c == ESCAPE_PREFIX) {

                switch (text.charAt(i + 1)) {
                    case '\'': c = '\''; referenceOffset = i + 1; break;
                    case '\\': c = '\\'; referenceOffset = i + 1; break;
                    // We weren't able to consume any valid escape chars, just not consider it an escape operation
                    default: referenceOffset = i; break;
                }

            }


            /*
             * At this point we know for sure we will need some kind of unescape, so we
             * can increase the offset and initialize the string builder if needed, along with
             * copying to it all the contents pending up to this point.
             */

            if (strBuilder == null) {
                strBuilder = new StringBuilder(max + 5);
            }

            if (i - readOffset > 0) {
                strBuilder.append(text, readOffset, i);
            }

            i = referenceOffset;
            readOffset = i + 1;

            /*
             * Write the unescaped char
             */
            strBuilder.append(c);

        }


        /*
         * -----------------------------------------------------------------------------------------------
         * Final cleaning: return the original String object if no unescape was actually needed. Otherwise
         *                 append the remaining escaped text to the string builder and return.
         * -----------------------------------------------------------------------------------------------
         */

        if (strBuilder == null) {
            return text;
        }

        if (max - readOffset > 0) {
            strBuilder.append(text, readOffset, max);
        }

        return strBuilder.toString();

    }
726942
public String getNextLine() {
		if (!isNextLine()) {
			return null;
		}
		if (isTag(nextLine))
			return FlatFileUtils.trimRight(nextLine,
					getTagWidth(nextLine));
		else
			return nextLine.trim();
	}
750088
public static String getInnerText(Node node)
	{
		if (node instanceof Element)
			return ((Element)node).getTextContent();
		if (node.getNodeType() == Node.TEXT_NODE)
			return node.getNodeValue();
		if (node instanceof Text)
			return ((Text)node).getData();
		return null;
	}
491727
public RFuture<String> getText (final String path) {
    final RPromise<String> result = exec.deferredPromise();
    exec.invokeAsync(new Runnable() {
      public void run () {
        try {
          result.succeed(getTextSync(path));
        } catch (Throwable t) {
          result.fail(t);
        }
      }
    });
    return result;
  }
1362271
public String readLine() throws IOException {
        StringBuilder str = new StringBuilder();
        while (true) {
            int c = read();
            if (c < 0) {
                break;
            }
            if (c == '\n') {
                // if possible consume another '\r'
                int peek = stream.read();
                if (peek != '\r' && peek >= 0){
                    stream.unread(peek);
                }
                break;
            }
            if (c == '\r') {
                // if possible consume another '\n'
                int peek = stream.read();
                if (peek != '\n' && peek >= 0){
                    stream.unread(peek);
                }
                break;
            }
            str.append((char) c);
        }
        return str.toString();
    }
783108
@Override
  @SuppressWarnings("unchecked")
  protected T getNext() {
    // if (lexer == null) {
    //   return null;
    // }
    try {
      return (T) lexer.next();
    } catch (IOException e) {
      throw new RuntimeIOException(e);
    }
    // cdm 2007: this shouldn't be necessary: PTBLexer decides for itself whether to return CRs based on the same flag!
    // get rid of CRs if necessary
    // while (!tokenizeNLs && PTBLexer.cr.equals(((HasWord) token).word())) {
    //   token = (T)lexer.next();
    // }

    // horatio: we used to catch exceptions here, which led to broken
    // behavior and made it very difficult to debug whatever the
    // problem was.
  }
1167337
public T getNext() throws IOException {
    try {
      return mapper.readValue(jsonParser, clazz);
    } catch (EOFException e) {
      return null;
    }
  }
555678
private boolean isEndOfLine(int c) throws IOException {
        // check if we have \r\n...
        if (c == '\r') {
            if (in.lookAhead() == '\n') {
                // note: does not change c outside of this method !!
                c = in.read();
            }
        }
        return (c == '\n');
    }