protected final int peek() { return p < stop ? enc.mbcToCode(bytes, p, stop) : 0; }
protected final void fetch() { c = enc.mbcToCode(bytes, p, stop); lastFetched = p; p += enc.length(bytes, p, stop); }
protected final void fetch() { c = enc.mbcToCode(bytes, p, stop); lastFetched = p; p += enc.length(bytes, p, stop); }
public static int codePoint(Encoding enc, byte[] bytes, int p, int end) { if (p >= end) throw new IllegalArgumentException("empty string"); int cl = preciseLength(enc, bytes, p, end); if (cl <= 0) throw new IllegalArgumentException("invalid byte sequence in " + enc); return enc.mbcToCode(bytes, p, end); }
public static int preciseCodePoint(Encoding enc, byte[]bytes, int p, int end) { int l = preciseLength(enc, bytes, p, end); if (l > 0) return enc.mbcToCode(bytes, p, end); return -1; }
public static int codePoint(Encoding enc, byte[] bytes, int p, int end) { if (p >= end) throw new IllegalArgumentException("empty string"); int cl = preciseLength(enc, bytes, p, end); if (cl <= 0) throw new IllegalArgumentException("invalid byte sequence in " + enc); return enc.mbcToCode(bytes, p, end); }
public static int preciseCodePoint(Encoding enc, byte[]bytes, int p, int end) { int l = preciseLength(enc, bytes, p, end); if (l > 0) return enc.mbcToCode(bytes, p, end); return -1; }
protected int fetchTo() { int to = enc.mbcToCode(bytes, p, stop); lastFetched = p; p += enc.length(bytes, p, stop); return to; }
public static int preciseCodePoint(Encoding enc, byte[]bytes, int p, int end) { int l = preciseLength(enc, bytes, p, end); if (l > 0) enc.mbcToCode(bytes, p, end); return -1; }
public static int preciseCodePoint(Encoding enc, byte[]bytes, int p, int end) { int l = preciseLength(enc, bytes, p, end); if (l > 0) enc.mbcToCode(bytes, p, end); return -1; }
static boolean isMbcAsciiWord(Encoding enc, byte[]bytes, int p, int end) { // ONIGENC_IS_MBC_ASCII_WORD return ASCIIEncoding.INSTANCE.isCodeCType(enc.mbcToCode(bytes, p, end), CharacterType.WORD); }
protected int fetchTo() { int to = enc.mbcToCode(bytes, p, stop); lastFetched = p; p += enc.length(bytes, p, stop); return to; }
private boolean isInClassMB() { int tlen = code[ip++]; if (s >= range) return false; int mbLen = enc.length(bytes, s, end); if (s + mbLen > range) return false; int ss = s; s += mbLen; int c = enc.mbcToCode(bytes, ss, s); if (!CodeRange.isInCodeRange(code, ip, c)) return false; ip += tlen; return true; }
private boolean isInClassMB() { int tlen = code[ip++]; if (s >= range) return false; int mbLen = enc.length(bytes, s, end); if (s + mbLen > range) return false; int ss = s; s += mbLen; int c = enc.mbcToCode(bytes, ss, s); if (!CodeRange.isInCodeRange(code, ip, c)) return false; ip += tlen; return true; }
private boolean isNotInClassMB() { int tlen = code[ip++]; int mbLen = enc.length(bytes, s, end); if (!(s + mbLen <= range)) { if (s >= range) return false; s = end; ip += tlen; return true; } int ss = s; s += mbLen; int c = enc.mbcToCode(bytes, ss, s); if (CodeRange.isInCodeRange(code, ip, c)) return false; ip += tlen; return true; }
public static int codePoint(Ruby runtime, Encoding enc, byte[]bytes, int p, int end) { if (p >= end) throw runtime.newArgumentError("empty string"); int cl = preciseLength(enc, bytes, p, end); if (cl <= 0) throw runtime.newArgumentError("invalid byte sequence in " + enc); return enc.mbcToCode(bytes, p, end); }
public static int codePoint(Ruby runtime, Encoding enc, byte[]bytes, int p, int end) { if (p >= end) throw runtime.newArgumentError("empty string"); int cl = preciseLength(enc, bytes, p, end); if (cl <= 0) throw runtime.newArgumentError("invalid byte sequence in " + enc); return enc.mbcToCode(bytes, p, end); }
public static long getAscii(Encoding enc, byte[]bytes, int p, int end, int len) { if (p >= end) return pack(-1, len); if (enc.isAsciiCompatible()) { int c = bytes[p] & 0xff; if (!Encoding.isAscii(c)) return pack(-1, len); return pack(c, len == 0 ? 0 : 1); } else { int cl = preciseLength(enc, bytes, p, end); if (cl <= 0) return pack(-1, len); int c = enc.mbcToCode(bytes, p, end); if (!Encoding.isAscii(c)) return pack(-1, len); return pack(c, len == 0 ? 0 : cl); } }
public static long getAscii(Encoding enc, byte[]bytes, int p, int end, int len) { if (p >= end) return pack(-1, len); if (enc.isAsciiCompatible()) { int c = bytes[p] & 0xff; if (!Encoding.isAscii(c)) return pack(-1, len); return pack(c, len == 0 ? 0 : 1); } else { int cl = preciseLength(enc, bytes, p, end); if (cl <= 0) return pack(-1, len); int c = enc.mbcToCode(bytes, p, end); if (!Encoding.isAscii(c)) return pack(-1, len); return pack(c, len == 0 ? 0 : cl); } }
public static long getAscii(Encoding enc, byte[]bytes, int p, int end, int len) { if (p >= end) return pack(-1, len); if (enc.isAsciiCompatible()) { int c = bytes[p] & 0xff; if (!Encoding.isAscii(c)) return pack(-1, len); return pack(c, len == 0 ? 0 : 1); } else { int cl = preciseLength(enc, bytes, p, end); if (cl <= 0) return pack(-1, len); int c = enc.mbcToCode(bytes, p, end); if (!Encoding.isAscii(c)) return pack(-1, len); return pack(c, len == 0 ? 0 : cl); } }