Checks if the buffer ends with the specified string. @param s the string to check @return true if the buffer ends with the specified string
(String s)
| 626 | * @return true if the buffer ends with the specified string |
| 627 | */ |
| 628 | public boolean endsWith(String s) { |
| 629 | char[] c = buff; |
| 630 | int len = s.length(); |
| 631 | if (c == null || len > end - start) { |
| 632 | return false; |
| 633 | } |
| 634 | int off = end - len; |
| 635 | for (int i = 0; i < len; i++) { |
| 636 | if (c[off++] != s.charAt(i)) { |
| 637 | return false; |
| 638 | } |
| 639 | } |
| 640 | return true; |
| 641 | } |
| 642 | |
| 643 | |
| 644 | @Override |