Package org.jruby.util
Class ConvertBytes
java.lang.Object
org.jruby.util.ConvertBytes
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanprivate intprivate intprivate static final byte[]private byte[]private static final boolean[]private intprivate static final byte[]private static final byte[][]private static final byte[]static final intprivate final Rubyprivate static final boolean[]private static final boolean[]private final ByteListprivate static final byte[]private static final byte[] -
Constructor Summary
ConstructorsConstructorDescriptionConvertBytes(Ruby runtime, ByteList str, int base, boolean badcheck) ConvertBytes(Ruby runtime, ByteList str, int base, boolean badcheck, boolean is19) Deprecated.ConvertBytes(Ruby runtime, ByteList str, int off, int end, int base, boolean badcheck) -
Method Summary
Modifier and TypeMethodDescriptionprivate IRubyObjectbigParse(int len, boolean sign, boolean exception) byteListToInum(boolean exception) static RubyIntegerbyteListToInum(Ruby runtime, ByteList str, int base, boolean badcheck) static IRubyObjectbyteListToInum(Ruby runtime, ByteList str, int base, boolean badcheck, boolean exception) rb_cstr_to_inumstatic RubyIntegerbyteListToInum(Ruby runtime, ByteList str, int off, int end, int base, boolean badcheck) static RubyIntegerbyteListToInum19(Ruby runtime, ByteList str, int base, boolean badcheck) Deprecated.static byte[]bytesToUUIDBytes(byte[] randBytes, boolean upper) private intprivate byteconvertDigit(byte c) conv_digitprivate static bytedecimalByteForDigit(long i) private voidprivate booleangetSign()private voidstatic final ByteListintToBinaryByteList(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 ByteListintToHexByteList(int i) static final ByteListintToHexByteList(int i, boolean upper) static final byte[]intToHexBytes(int i) static final byte[]intToHexBytes(int i, boolean upper) static final ByteListintToOctalByteList(int i) static final byte[]intToOctalBytes(int i) private static final ByteListintToUnsignedByteList(int i, int shift, byte[] digitmap) private voidinvalidString(String type) rb_invalid_strprivate booleanisSpace(int str) ISSPACEstatic final voidlongIntoString(RubyString string, long i) static final voidlongIntoStringSimple(RubyString string, long i) static final ByteListlongToBinaryByteList(long i) static final byte[]longToBinaryBytes(long i) static final byte[]longToByteArray(long i, int radix, boolean upper) static final ByteListlongToByteList(long i) static final ByteListlongToByteList(long i, int radix) static final ByteListlongToByteList(long i, int radix, byte[] digitmap) static final ByteListlongToByteListSimple(long i) static final byte[]longToCharBytes(long i) static final ByteListlongToHexByteList(long i) static final ByteListlongToHexByteList(long i, boolean upper) static final byte[]longToHexBytes(long i) static final byte[]longToHexBytes(long i, boolean upper) static final ByteListlongToOctalByteList(long i) static final byte[]longToOctalBytes(long i) private static final ByteListlongToUnsignedByteList(long i, int shift, byte[] digitmap) private static intsizeWithDecimalString(long i, boolean neg, int baseSize) private voidprivate BigIntegerstringToBig(String str) private longstringToLong(int nptr, int[] endptr, int base) private intstatic 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) private static voidwriteDecimalDigitsToArray(byte[] bytes, long i, boolean negative, int begin, int originalSize, int newSize)
-
Field Details
-
runtime
-
str
-
beg
private int beg -
end
private int end -
data
private byte[] data -
base
private int base -
badcheck
private final boolean badcheck -
ZERO_BYTES
private static final byte[] ZERO_BYTES -
MIN_VALUE_BYTES
private static final byte[][] MIN_VALUE_BYTES -
MIN_VALUE_BYTES_RADIX_10
private static final byte[] MIN_VALUE_BYTES_RADIX_10 -
MIN_VALUE_BYTES_RADIX_10_LENGTH
public static final int MIN_VALUE_BYTES_RADIX_10_LENGTH -
LOWER_DIGITS
private static final byte[] LOWER_DIGITS -
UPPER_DIGITS
private static final byte[] UPPER_DIGITS -
conv_digit
private static final byte[] conv_digit -
digit
private static final boolean[] digit -
space
private static final boolean[] space -
spaceOrUnderscore
private static final boolean[] spaceOrUnderscore
-
-
Constructor Details
-
ConvertBytes
-
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
-
longToByteList
-
longIntoString
-
longToByteList
-
longToByteListSimple
-
longToCharBytes
public static final byte[] longToCharBytes(long i) -
longIntoStringSimple
-
sizeWithDecimalString
private static int sizeWithDecimalString(long i, boolean neg, int baseSize) -
writeDecimalDigitsToArray
private static void writeDecimalDigitsToArray(byte[] bytes, long i, boolean negative, int begin, int originalSize, int newSize) -
decimalByteForDigit
private static byte decimalByteForDigit(long i) -
intToUnsignedByteList
-
longToUnsignedByteList
-
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) -
byteListToInum19
@Deprecated public static RubyInteger byteListToInum19(Ruby runtime, ByteList str, int base, boolean badcheck) Deprecated. -
bytesToUUIDBytes
public static byte[] bytesToUUIDBytes(byte[] randBytes, boolean upper) -
convertDigit
private byte convertDigit(byte c) conv_digit -
isSpace
private boolean isSpace(int str) ISSPACE -
getSign
private boolean getSign() -
ignoreLeadingWhitespace
private void ignoreLeadingWhitespace() -
figureOutBase
private void figureOutBase() -
calculateLength
private int calculateLength() -
squeezeZeroes
private void squeezeZeroes() -
stringToLong
private long stringToLong(int nptr, int[] endptr, int base) -
byteListToInum
-
trailingLength
private int trailingLength() -
bigParse
-
stringToBig
-
invalidString
rb_invalid_str
-