/** * Get the index of last occurrence of find in ByteList from the end of the ByteList. * * @param find ByteList to be looking for * @param pos index from end of list to search from * @return the index of the byte or -1 if not found */ public int lastIndexOf(ByteList find, int pos) { return lastIndexOf(bytes, begin, realSize, find.bytes, find.begin, find.realSize, pos); }
/** * Get the index of last occurrence of find in ByteList from the end of the ByteList. * * @param find ByteList to be looking for * @return the index of the byte or -1 if not found */ public int lastIndexOf(ByteList find) { return lastIndexOf(find, realSize); }
/** * Get the index of last occurrence of c in ByteList from the end of the ByteList. * * @param c byte to be looking for * @return the index of the byte or -1 if not found */ public int lastIndexOf(int c) { return lastIndexOf(c, realSize - 1); }
/** * Get the index of last occurrence of find in ByteList from the end of the ByteList. * * @param find ByteList to be looking for * @param pos index from end of list to search from * @return the index of the byte or -1 if not found */ public int lastIndexOf(ByteList find, int pos) { return lastIndexOf(bytes, begin, realSize, find.bytes, find.begin, find.realSize, pos); }
/** * Get the index of last occurrence of c in ByteList from the end of the ByteList. * * @param c byte to be looking for * @return the index of the byte or -1 if not found */ public int lastIndexOf(int c) { return lastIndexOf(c, realSize - 1); }
/** * Get the index of last occurrence of find in ByteList from the end of the ByteList. * * @param find ByteList to be looking for * @return the index of the byte or -1 if not found */ public int lastIndexOf(ByteList find) { return lastIndexOf(find, realSize); }
/** * Get the index of last occurrence of c in ByteList from the end of the ByteList. * * @param c byte to be looking for * @return the index of the byte or -1 if not found */ public int lastIndexOf(int c) { return lastIndexOf(c, realSize - 1); }
/** * Get the index of last occurrence of find in ByteList from the end of the ByteList. * * @param find ByteList to be looking for * @return the index of the byte or -1 if not found */ public int lastIndexOf(ByteList find) { return lastIndexOf(find, realSize); }
private int strRindex(RubyString sub, int pos) { int subLength = sub.value.realSize; /* substring longer than string */ if (value.realSize < subLength) return -1; if (value.realSize - pos < subLength) pos = value.realSize - subLength; return value.lastIndexOf(sub.value, pos); }
/** * Get the index of last occurrence of find in ByteList from the end of the ByteList. * * @param find ByteList to be looking for * @param pos index from end of list to search from * @return the index of the byte or -1 if not found */ public int lastIndexOf(ByteList find, int pos) { return lastIndexOf(bytes, begin, realSize, find.bytes, find.begin, find.realSize, pos); }
static boolean isMimeText(ByteList str, Map<String, NKFCharset> options) { if (str.length() <= 6) { return false; } if (options.get("mime-decode") == NOCONV) { return false; } if (str.indexOf(BEGIN_MIME_STRING) < 0) { return false; } if (str.lastIndexOf(END_MIME_STRING) < 0) { return false; } return true; }
static boolean isMimeText(ByteList str, Map<String, NKFCharset> options) { if (str.length() <= 6) { return false; } if (options.get("mime-decode") == NOCONV) { return false; } if (str.indexOf(BEGIN_MIME_STRING) < 0) { return false; } if (str.lastIndexOf(END_MIME_STRING) < 0) { return false; } return true; }
static boolean isMimeText(ByteList str, Map<String, NKFCharset> options) { if (str.length() <= 6) { return false; } if (options.get("mime-decode") == NKFCharset.NOCONV) { return false; } if (str.indexOf(BEGIN_MIME_STRING) < 0) { return false; } if (str.lastIndexOf(END_MIME_STRING) < 0) { return false; } return true; }
static boolean isMimeText(ByteList str, Map<String, NKFCharset> options) { if (str.length() <= 6) { return false; } if (options.get("mime-decode") == NKFCharset.NOCONV) { return false; } if (str.indexOf(BEGIN_MIME_STRING) < 0) { return false; } if (str.lastIndexOf(END_MIME_STRING) < 0) { return false; } return true; }
private int strRindex(RubyString sub, int pos) { int subLength = sub.value.getRealSize(); /* substring longer than string */ if (value.getRealSize() < subLength) return -1; if (value.getRealSize() - pos < subLength) pos = value.getRealSize() - subLength; return value.lastIndexOf(sub.value, pos); }
private int strRindex(RubyString sub, int pos) { int subLength = sub.value.getRealSize(); /* substring longer than string */ if (value.getRealSize() < subLength) return -1; if (value.getRealSize() - pos < subLength) pos = value.getRealSize() - subLength; return value.lastIndexOf(sub.value, pos); }