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)
| 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 | /** |