Checks if the InputStream have the text

@param in InputStream to read
@param text Text to check
@return whether the inputstream has the text
424399
public static boolean streamHasText(InputStream in, String text) {
    final byte[] readBuffer = new byte[8192];

    StringBuffer sb = new StringBuffer();
    try {
      if (in.available() > 0) {
        int bytesRead = 0;
        while ((bytesRead = in.read(readBuffer)) != -1) {
          sb.append(new String(readBuffer, 0, bytesRead));

          if (sb.toString().contains(text)) {
            sb = null;
            return true;
          }
        }
      }
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      try {
        in.close();
      } catch (IOException e) {
        e.printStackTrace();
      }
    }

    return false;
  }
768699
public boolean hasKeyword(String text)
    {
        checkForConstructedFailureStates();

        State currentState = this.rootState;
        for (int i = 0; i < text.length(); ++i)
        {
        	State nextState = getState(currentState, text.charAt(i));
            if (nextState != null && nextState != currentState && nextState.emit().size() != 0) {
                return true;
            }
            currentState = nextState;
        }
        return false;
    }
1192244
public boolean isSpinnerTextSelected(String text)
	{
		waiter.waitForAndGetView(0, Spinner.class);
				
		ArrayList<Spinner> spinnerList = viewFetcher.getCurrentViews(Spinner.class, true);
		for(int i = 0; i < spinnerList.size(); i++){
			if(isSpinnerTextSelected(i, text))
					return true;
		}
		return false;
	}
660391
private static Long parseLong(final String text) {
		if (text.length() == 0) {
			return null;
		} else {
			try {
				return Long.parseLong(text);
			} catch (NumberFormatException ex) {
				return null;
			}
		}
	}
408572
@Override @DefinedBy(Api.COMPILER_TREE)
    public Void visitText(TextTree tree, Void ignore) {
        if (hasNonWhitespace(tree)) {
            checkAllowsText(tree);
            markEnclosingTag(Flag.HAS_TEXT);
        }
        return null;
    }
1139527
private void readFully(InputStream in, byte[] bytes) throws IOException {
        int read = ByteStreams.read(in, bytes, 0, bytes.length);
        if (read == 0) {
            throw new NoBytesReadException();
        } else if (read != bytes.length) {
            throw new EOFException("reached end of stream after reading "
                    + read + " bytes; " + bytes.length + " bytes expected");
        }
    }
80243
private static boolean expect(BufferedReader in, String key) throws IOException {
        String s = in.readLine();
        if (s != null && s.equals(key)) {
            return true;
        }
        return false;
    }
1274197
public boolean read(InputStream stream) throws IOException
    {
        valid = false;
        InputStreamReader reader = new InputStreamReader(stream);

        // Load the file contents
        contents = getContents(reader, "\n");
        if(contents != null)
            valid = true;
        else
            logger.severe("Unable to read file contents: "+filename);

        try
        {
            if(reader != null)
                reader.close();
        }
        catch(IOException e)
        {
        }

        return valid;
    }
526288
public boolean isTextPresentInPage(final String text) {
		WebElement body = driver.findElement(By.tagName("body"));
		return body.getText().contains(text);
	}
107023
public static String readTextFile(InputStream inputStream) {
        InputStreamReader streamReader = new InputStreamReader(inputStream);
        return readTextFile(streamReader);
    }
643096
public boolean hasNext() {
		if(cachedNext != null) {
			return true;
		}
		while(cachedNext == null) {
			if(br != null) {
				// attempt to read the next line from this:
				try {
					cachedNext = br.readLine();
					if(cachedNext == null) {
						br = null;
						// next loop:
					} else {
						return true;
					}
				} catch (IOException e) {
					e.printStackTrace();
					br = null;
				}
			} else {
				// do we have more blocks to use?
				if(blockItr.hasNext()) {
					try {
						br = blockItr.next().readBlock();
					} catch (IOException e) {
						throw new RuntimeIOException();
					}
				} else {
					return false;
				}
			}
		}
		
		return false;
	}
592609
public boolean startsWith(CharSequence text)
    {
        try
        {
            if (text.length() == 0)
            {
                if (acceptEmpty)
                {
                    return true;
                }
                else
                {
                    throw new SyntaxErrorException("empty string not accepted");
                }
            }
            InputReader reader = Input.getInstance(text);
            return startsWith(reader);
        }
        catch (IOException ex)
        {
            throw new IllegalArgumentException("can't happen");
        }
    }
706786
protected boolean verifyPatternMatch(String text) {
		if (this.expectedPattern == null) {
			return false;
		}
		return this.expectedPattern.matcher(text).matches();
	}
522786
public boolean sms(final String from, final String to, final String text) {
        if (!isSmsSenderDefined() || StringUtils.isBlank(text) || StringUtils.isBlank(from)) {
            LOGGER.warn("Could not send SMS to [{}] because either no from/text is found or SMS settings are not configured.", to);
            return false;
        }
        return this.smsSender.send(from, to, text);
    }
373282
protected boolean validate(String text)
	{
		try
		{
			String[] strings = text.split(",");
			for (int i = 0; i < strings.length; i++)
			{
				Integer.parseInt(strings[i].trim());
			}
			return true;
		}
		catch (NumberFormatException e)
		{
			return false;
		}
	}
1006351
public static boolean isStringTrue(String in) {
    if (in == null)
      return false;
    return in.equalsIgnoreCase("TRUE") || in.equalsIgnoreCase("YES") || in.equals("1");
  }
145152
public String lookingAt(CharSequence text)
    {
        try
        {
            if (text.length() == 0)
            {
                if (acceptEmpty)
                {
                    return "";
                }
                else
                {
                    throw new SyntaxErrorException("empty string not accepted");
                }
            }
            InputReader reader = Input.getInstance(text);
            return lookingAt(reader);
        }
        catch (IOException ex)
        {
            throw new IllegalArgumentException("can't happen");
        }
    }