MCPcopy Create free account
hub / github.com/apache/tomcat / startsWith

Method startsWith

java/org/apache/tomcat/util/buf/CharChunk.java:574–587  ·  view source on GitHub ↗

Checks if the buffer starts with the specified string. @param s the string to check @return true if the buffer starts with the specified string

(String s)

Source from the content-addressed store, hash-verified

572 * @return true if the buffer starts with the specified string
573 */
574 public boolean startsWith(String s) {
575 char[] c = buff;
576 int len = s.length();
577 if (c == null || len > end - start) {
578 return false;
579 }
580 int off = start;
581 for (int i = 0; i < len; i++) {
582 if (c[off++] != s.charAt(i)) {
583 return false;
584 }
585 }
586 return true;
587 }
588
589
590 /**

Callers 15

acceptsURLMethod · 0.45
startsWithStringArrayMethod · 0.45
testBug49726aMethod · 0.45
testBug49726bMethod · 0.45
testBug56581Method · 0.45
testBug55807Method · 0.45
testCVE_2023_41080Method · 0.45

Calls 2

lengthMethod · 0.80
charAtMethod · 0.80

Tested by 15

acceptsURLMethod · 0.36
testBug49726aMethod · 0.36
testBug49726bMethod · 0.36
testBug56581Method · 0.36
testBug55807Method · 0.36
testCVE_2023_41080Method · 0.36
willDecodeMethod · 0.36
willDecodeMethod · 0.36