Package org.jruby.util
Class ConvertBytes
java.lang.Object
org.jruby.util.ConvertBytes
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConvertBytes
(Ruby runtime, ByteList str, int base, boolean badcheck) ConvertBytes
(Ruby runtime, ByteList str, int base, boolean badcheck, boolean is19) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionbyteListToInum
(boolean exception) static RubyInteger
byteListToInum
(Ruby runtime, ByteList str, int base, boolean badcheck) static IRubyObject
byteListToInum
(Ruby runtime, ByteList str, int base, boolean badcheck, boolean exception) rb_cstr_to_inumstatic RubyInteger
byteListToInum
(Ruby runtime, ByteList str, int off, int end, int base, boolean badcheck) static byte[]
bytesToUUIDBytes
(byte[] randBytes, boolean upper) static final ByteList
byteToSharedByteList
(short i) Return a cached ByteList for values -256..255.static final ByteList
intToBinaryByteList
(int i) static final byte[]
intToBinaryBytes
(int i) static final byte[]
intToByteArray
(int i, int radix, boolean upper) static final byte[]
intToCharBytes
(int i) static final ByteList
intToHexByteList
(int i) static final ByteList
intToHexByteList
(int i, boolean upper) static final byte[]
intToHexBytes
(int i) static final byte[]
intToHexBytes
(int i, boolean upper) static final ByteList
intToOctalByteList
(int i) static final byte[]
intToOctalBytes
(int i) static final void
longIntoString
(RubyString string, long i) static final void
longIntoStringSimple
(RubyString string, long i) static final ByteList
longToBinaryByteList
(long i) static final byte[]
longToBinaryBytes
(long i) static final byte[]
longToByteArray
(long i, int radix, boolean upper) static final ByteList
longToByteList
(long i) Produce a new ByteList of the given long as a string in radix 10.static final ByteList
longToByteList
(long i, int radix) Produce a new ByteList of the given long as a string in the given radix.static final ByteList
longToByteList
(long i, int radix, byte[] digitmap) static final ByteList
longToByteListCached
(long i) Produce a ByteList of the radix 10 string form of the given long, possibly returning a cached instance for certain ranges.static final ByteList
longToByteListSimple
(long i) static final byte[]
longToCharBytes
(long i) static final ByteList
longToHexByteList
(long i) static final ByteList
longToHexByteList
(long i, boolean upper) static final byte[]
longToHexBytes
(long i) static final byte[]
longToHexBytes
(long i, boolean upper) static final ByteList
longToOctalByteList
(long i) static final byte[]
longToOctalBytes
(long i) static final byte[]
twosComplementToBinaryBytes
(byte[] in) static final byte[]
twosComplementToHexBytes
(byte[] in, boolean upper) static final byte[]
twosComplementToOctalBytes
(byte[] in) static final byte[]
twosComplementToUnsignedBytes
(byte[] in, int shift, boolean upper)
-
Field Details
-
MIN_VALUE_BYTES_RADIX_10_LENGTH
public static final int MIN_VALUE_BYTES_RADIX_10_LENGTH
-
-
Constructor Details
-
ConvertBytes
-
ConvertBytes
@Deprecated public ConvertBytes(Ruby runtime, ByteList str, int base, boolean badcheck, boolean is19) Deprecated.
-
-
Method Details
-
intToBinaryBytes
public static final byte[] intToBinaryBytes(int i) -
intToOctalBytes
public static final byte[] intToOctalBytes(int i) -
intToHexBytes
public static final byte[] intToHexBytes(int i) -
intToHexBytes
public static final byte[] intToHexBytes(int i, boolean upper) -
intToBinaryByteList
-
intToOctalByteList
-
intToHexByteList
-
intToHexByteList
-
intToByteArray
public static final byte[] intToByteArray(int i, int radix, boolean upper) -
intToCharBytes
public static final byte[] intToCharBytes(int i) -
longToBinaryBytes
public static final byte[] longToBinaryBytes(long i) -
longToOctalBytes
public static final byte[] longToOctalBytes(long i) -
longToHexBytes
public static final byte[] longToHexBytes(long i) -
longToHexBytes
public static final byte[] longToHexBytes(long i, boolean upper) -
longToBinaryByteList
-
longToOctalByteList
-
longToHexByteList
-
longToHexByteList
-
longToByteArray
public static final byte[] longToByteArray(long i, int radix, boolean upper) -
longToByteList
Produce a new ByteList of the given long as a string in radix 10.- Parameters:
i
-- Returns:
-
longToByteList
Produce a new ByteList of the given long as a string in the given radix.- Parameters:
i
-radix
-- Returns:
-
longToByteListCached
Produce a ByteList of the radix 10 string form of the given long, possibly returning a cached instance for certain ranges. The result is suitable for places where transient ByteList are immediately appended into another buffer.- Parameters:
i
-- Returns:
-
longIntoString
-
longToByteList
-
longToByteListSimple
-
longToCharBytes
public static final byte[] longToCharBytes(long i) -
longIntoStringSimple
-
twosComplementToBinaryBytes
public static final byte[] twosComplementToBinaryBytes(byte[] in) -
twosComplementToOctalBytes
public static final byte[] twosComplementToOctalBytes(byte[] in) -
twosComplementToHexBytes
public static final byte[] twosComplementToHexBytes(byte[] in, boolean upper) -
twosComplementToUnsignedBytes
public static final byte[] twosComplementToUnsignedBytes(byte[] in, int shift, boolean upper) -
byteListToInum
public static IRubyObject byteListToInum(Ruby runtime, ByteList str, int base, boolean badcheck, boolean exception) rb_cstr_to_inum -
byteListToInum
-
byteListToInum
public static RubyInteger byteListToInum(Ruby runtime, ByteList str, int off, int end, int base, boolean badcheck) -
bytesToUUIDBytes
public static byte[] bytesToUUIDBytes(byte[] randBytes, boolean upper) -
byteListToInum
-