public static final ByteList longToBinaryByteList(long i) { return longToByteList(i, 2, LOWER_DIGITS); } public static final ByteList longToOctalByteList(long i) {
public static final ByteList longToBinaryByteList(long i) { return longToByteList(i, 2, LOWER_DIGITS); } public static final ByteList longToOctalByteList(long i) {
public static final ByteList longToBinaryByteList(long i) { return longToByteList(i, 2, LOWER_DIGITS); } public static final ByteList longToOctalByteList(long i) {
public static final ByteList longToHexByteList(long i) { return longToByteList(i, 16, LOWER_DIGITS); } public static final ByteList longToHexByteList(long i, boolean upper) {
public static final ByteList longToOctalByteList(long i) { return longToByteList(i, 8, LOWER_DIGITS); } public static final ByteList longToHexByteList(long i) {
public static final ByteList longToOctalByteList(long i) { return longToByteList(i, 8, LOWER_DIGITS); } public static final ByteList longToHexByteList(long i) {
public static final ByteList longToByteList(long i, int radix) { return longToByteList(i, radix, LOWER_DIGITS); }
@Override public RubyString to_s() { ByteList bytes = ConvertBytes.longToByteList(value, 10); return RubyString.newString(getRuntime(), bytes, USASCIIEncoding.INSTANCE); }
@Override public RubyString to_s() { ByteList bytes = ConvertBytes.longToByteList(value, 10); return RubyString.newString(getRuntime(), bytes, USASCIIEncoding.INSTANCE); }
@Override public RubyString to_s(IRubyObject arg0) { int base = num2int(arg0); if (base < 2 || base > 36) { throw getRuntime().newArgumentError("illegal radix " + base); } ByteList bytes = ConvertBytes.longToByteList(value, base); return RubyString.newString(getRuntime(), bytes, USASCIIEncoding.INSTANCE); }
@Override public RubyString to_s(IRubyObject arg0) { int base = num2int(arg0); if (base < 2 || base > 36) { throw getRuntime().newArgumentError("illegal radix " + base); } ByteList bytes = ConvertBytes.longToByteList(value, base); return RubyString.newString(getRuntime(), bytes, USASCIIEncoding.INSTANCE); }
@JRubyMethod @Override public RubyString to_s() { int base = 10; ByteList bl = ConvertBytes.longToByteList(value, base); if (getRuntime().is1_9()) bl.setEncoding(USASCIIEncoding.INSTANCE); return getRuntime().newString(bl); }
@JRubyMethod @Override public RubyString to_s() { int base = 10; ByteList bl = ConvertBytes.longToByteList(value, base); if (getRuntime().is1_9()) bl.setEncoding(USASCIIEncoding.INSTANCE); return getRuntime().newString(bl); }
public RubyString append19(IRubyObject other) { if (other instanceof RubyFixnum) { cat19(ConvertBytes.longToByteList(((RubyFixnum)other).getLongValue()), StringSupport.CR_7BIT); return this; } else if (other instanceof RubyFloat) { return cat19((RubyString)((RubyFloat)other).to_s()); } else if (other instanceof RubySymbol) { cat19(((RubySymbol)other).getBytes(), 0); return this; } return cat19(other.convertToString()); }
public RubyString append19(IRubyObject other) { if (other instanceof RubyFixnum) { cat19(ConvertBytes.longToByteList(((RubyFixnum)other).getLongValue()), StringSupport.CR_7BIT); return this; } else if (other instanceof RubyFloat) { return cat19((RubyString)((RubyFloat)other).to_s()); } else if (other instanceof RubySymbol) { cat19(((RubySymbol)other).getBytes(), 0); return this; } return cat19(other.convertToString()); }
@JRubyMethod public RubyString to_s(IRubyObject arg0) { int base = num2int(arg0); if (base < 2 || base > 36) { throw getRuntime().newArgumentError("illegal radix " + base); } ByteList bl = ConvertBytes.longToByteList(value, base); if (getRuntime().is1_9()) bl.setEncoding(USASCIIEncoding.INSTANCE); return getRuntime().newString(bl); }
@JRubyMethod public RubyString to_s(IRubyObject arg0) { int base = num2int(arg0); if (base < 2 || base > 36) { throw getRuntime().newArgumentError("illegal radix " + base); } ByteList bl = ConvertBytes.longToByteList(value, base); if (getRuntime().is1_9()) bl.setEncoding(USASCIIEncoding.INSTANCE); return getRuntime().newString(bl); }
public RubyString append19(IRubyObject other) { modifyCheck(); if (other instanceof RubyFixnum) { cat19(ConvertBytes.longToByteList(((RubyFixnum) other).getLongValue()), StringSupport.CR_7BIT); return this; } else if (other instanceof RubyFloat) { return cat19((RubyString) ((RubyFloat) other).to_s()); } else if (other instanceof RubySymbol) { cat19(((RubySymbol) other).getBytes(), 0); return this; } return cat19(other.convertToString()); }
public RubyString append19(IRubyObject other) { modifyCheck(); if (other instanceof RubyFixnum) { cat19(ConvertBytes.longToByteList(((RubyFixnum) other).getLongValue()), StringSupport.CR_7BIT); return this; } else if (other instanceof RubyFloat) { return cat19((RubyString) ((RubyFloat) other).to_s()); } else if (other instanceof RubySymbol) { cat19(((RubySymbol) other).getBytes(), 0); return this; } return cat19(other.convertToString()); }
public static RubyString to_s_mri(ThreadContext context, RubyStackTraceElement element) { RubySymbol methodSym = context.runtime.newSymbol(element.getMethodName()); RubyString line = context.runtime.newString(new ByteList(methodSym.getBytes().length() + element.getFileName().length() + 18)); line.setEncoding(methodSym.getEncoding()); line.cat(element.getFileName().getBytes()); line.cat(CommonByteLists.COLON); line.cat(ConvertBytes.longToByteList(element.getLineNumber())); line.cat(CommonByteLists.BACKTRACE_IN); if (element.getFrameType() == FrameType.BLOCK) line.catString("block in "); line.cat(methodSym.getBytes()); line.cat('\''); return line; }