private static boolean dir_fnmatch(ByteList pattern, ByteList path, int flags) { return org.jruby.util.Dir.fnmatch(pattern.getUnsafeBytes(), pattern.getBegin(), pattern.getBegin()+pattern.getRealSize(), path.getUnsafeBytes(), path.getBegin(), path.getBegin()+path.getRealSize(), flags) == 0; }
public static int offset(RubyString str, int pos) { ByteList value = str.getByteList(); return offset(str.getEncoding(), value.getUnsafeBytes(), value.getBegin(), value.getBegin() + value.getRealSize(), pos); }
private RubyString strioSubstr(Ruby runtime, int pos, int len) { RubyString str = ptr.string; ByteList strByteList = str.getByteList(); byte[] strBytes = strByteList.getUnsafeBytes(); Encoding enc = str.getEncoding(); int rlen = str.size() - pos; if (len > rlen) len = rlen; if (len < 0) len = 0; if (len == 0) return RubyString.newEmptyString(runtime); return RubyString.newStringShared(runtime, strBytes, strByteList.getBegin() + pos, len, enc); }
private static boolean lastCharDigit(RubyString str) { ByteList bytes = str.getByteList(); return ASCIIEncoding.INSTANCE.isDigit(bytes.getUnsafeBytes()[bytes.getBegin() + bytes.getRealSize() - 1]); }
public TR(ByteList bytes) { p = bytes.getBegin(); pend = bytes.getRealSize() + p; buf = bytes.getUnsafeBytes(); now = max = 0; gen = false; }
private RubyString strioSubstr(Ruby runtime, int pos, int len) { RubyString str = ptr.string; ByteList strByteList = str.getByteList(); byte[] strBytes = strByteList.getUnsafeBytes(); Encoding enc = str.getEncoding(); int rlen = str.size() - pos; if (len > rlen) len = rlen; if (len < 0) len = 0; if (len == 0) return RubyString.newEmptyString(runtime); return RubyString.newStringShared(runtime, strBytes, strByteList.getBegin() + pos, len, enc); }
public static int offset(RubyString str, int pos) { ByteList value = str.getByteList(); return offset(str.getEncoding(), value.getUnsafeBytes(), value.getBegin(), value.getBegin() + value.getRealSize(), pos); }
public TR(ByteList bytes) { p = bytes.getBegin(); pend = bytes.getRealSize() + p; buf = bytes.getUnsafeBytes(); now = max = 0; gen = false; }
private RubyString strioSubstr(Ruby runtime, int pos, int len) { RubyString str = ptr.string; ByteList strByteList = str.getByteList(); byte[] strBytes = strByteList.getUnsafeBytes(); Encoding enc = str.getEncoding(); int rlen = str.size() - pos; if (len > rlen) len = rlen; if (len < 0) len = 0; if (len == 0) return RubyString.newEmptyString(runtime); return RubyString.newStringShared(runtime, strBytes, strByteList.getBegin() + pos, len, enc); }
private static boolean lastCharDigit(RubyString str) { ByteList bytes = str.getByteList(); return ASCIIEncoding.INSTANCE.isDigit(bytes.getUnsafeBytes()[bytes.getBegin() + bytes.getRealSize() - 1]); }
private static boolean dir_fnmatch(ByteList pattern, ByteList path, int flags) { return org.jruby.util.Dir.fnmatch(pattern.getUnsafeBytes(), pattern.getBegin(), pattern.getBegin()+pattern.getRealSize(), path.getUnsafeBytes(), path.getBegin(), path.getBegin()+path.getRealSize(), flags) == 0; }
private RubyString strioSubstr(Ruby runtime, int pos, int len) { RubyString str = ptr.string; ByteList strByteList = str.getByteList(); byte[] strBytes = strByteList.getUnsafeBytes(); Encoding enc = str.getEncoding(); int rlen = str.size() - pos; if (len > rlen) len = rlen; if (len < 0) len = 0; if (len == 0) return RubyString.newEmptyString(runtime); return RubyString.newStringShared(runtime, strBytes, strByteList.getBegin() + pos, len, enc); }
public static int offset(RubyString str, int pos) { ByteList value = str.getByteList(); return offset(str.getEncoding(), value.getUnsafeBytes(), value.getBegin(), value.getBegin() + value.getRealSize(), pos); }
public ConvertBytes(Ruby runtime, ByteList _str, int base, boolean badcheck, boolean is19) { this.runtime = runtime; this._str = _str; this.str = _str.getBegin(); this.data = _str.getUnsafeBytes(); this.end = str + _str.getRealSize(); this.badcheck = badcheck; this.base = base; this.is19 = is19; }
private RubyString strioSubstr(Ruby runtime, int pos, int len, Encoding enc) { StringIOData ptr = this.ptr; synchronized (ptr) { final RubyString string = ptr.string; final ByteList stringBytes = string.getByteList(); int rlen = string.size() - pos; if (len > rlen) len = rlen; if (len < 0) len = 0; if (len == 0) return RubyString.newEmptyString(runtime, enc); string.setByteListShared(); // we only share the byte[] buffer but its easier this way return RubyString.newStringShared(runtime, stringBytes.getUnsafeBytes(), stringBytes.getBegin() + pos, len, enc); } }
private static boolean lastCharDigit(RubyString str) { ByteList bytes = str.getByteList(); return ASCIIEncoding.INSTANCE.isDigit(bytes.getUnsafeBytes()[bytes.getBegin() + bytes.getRealSize() - 1]); }
public ConvertBytes(Ruby runtime, ByteList str, int base, boolean badcheck) { this.runtime = runtime; this.str = str; this.beg = str.getBegin(); this.data = str.getUnsafeBytes(); this.end = beg + str.getRealSize(); this.badcheck = badcheck; this.base = base; }
private RubyString strioSubstr(Ruby runtime, int pos, int len, Encoding enc) { StringIOData ptr = this.ptr; synchronized (ptr) { final RubyString string = ptr.string; final ByteList stringBytes = string.getByteList(); int rlen = string.size() - pos; if (len > rlen) len = rlen; if (len < 0) len = 0; if (len == 0) return RubyString.newEmptyString(runtime, enc); string.setByteListShared(); // we only share the byte[] buffer but its easier this way return RubyString.newStringShared(runtime, stringBytes.getUnsafeBytes(), stringBytes.getBegin() + pos, len, enc); } }
private static boolean lastCharDigit(RubyString str) { ByteList bytes = str.getByteList(); return ASCIIEncoding.INSTANCE.isDigit(bytes.getUnsafeBytes()[bytes.getBegin() + bytes.getRealSize() - 1]); }
public ConvertBytes(Ruby runtime, ByteList str, int base, boolean badcheck) { this.runtime = runtime; this.str = str; this.beg = str.getBegin(); this.data = str.getUnsafeBytes(); this.end = beg + str.getRealSize(); this.badcheck = badcheck; this.base = base; }