public class ConvertBytes
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ConvertBytes.ERange |
| Modifier and Type | Field and Description |
|---|---|
private org.jruby.util.ByteList |
_str |
private boolean |
badcheck |
private int |
base |
private static byte[] |
conv_digit |
private byte[] |
data |
private static boolean[] |
digit |
private int |
end |
private boolean |
is19 |
private static byte[] |
LOWER_DIGITS |
private static byte[][] |
MIN_VALUE_BYTES |
private Ruby |
runtime |
private static boolean[] |
space |
private static boolean[] |
spaceOrUnderscore |
private int |
str |
private static byte[] |
UPPER_DIGITS |
private static byte[] |
ZERO_BYTES |
| Constructor and Description |
|---|
ConvertBytes(Ruby runtime,
org.jruby.util.ByteList _str,
int base,
boolean badcheck) |
ConvertBytes(Ruby runtime,
org.jruby.util.ByteList _str,
int base,
boolean badcheck,
boolean is19) |
| Modifier and Type | Method and Description |
|---|---|
private RubyInteger |
bigParse(int len,
boolean sign) |
RubyInteger |
byteListToInum() |
static RubyInteger |
byteListToInum(Ruby runtime,
org.jruby.util.ByteList str,
int base,
boolean badcheck)
rb_cstr_to_inum
|
static RubyInteger |
byteListToInum19(Ruby runtime,
org.jruby.util.ByteList str,
int base,
boolean badcheck) |
static byte[] |
bytesToUUIDBytes(byte[] randBytes,
boolean upper) |
private int |
calculateLength() |
private byte |
convertDigit(byte c)
conv_digit
|
private void |
figureOutBase() |
private boolean |
getSign() |
private void |
ignoreLeadingWhitespace() |
static org.jruby.util.ByteList |
intToBinaryByteList(int i) |
static byte[] |
intToBinaryBytes(int i) |
static byte[] |
intToByteArray(int i,
int radix,
boolean upper) |
static byte[] |
intToCharBytes(int i) |
static org.jruby.util.ByteList |
intToHexByteList(int i) |
static org.jruby.util.ByteList |
intToHexByteList(int i,
boolean upper) |
static byte[] |
intToHexBytes(int i) |
static byte[] |
intToHexBytes(int i,
boolean upper) |
static org.jruby.util.ByteList |
intToOctalByteList(int i) |
static byte[] |
intToOctalBytes(int i) |
private static org.jruby.util.ByteList |
intToUnsignedByteList(int i,
int shift,
byte[] digitmap) |
private void |
invalidString(java.lang.String type)
rb_invalid_str
|
private boolean |
isDigit(byte[] buf,
int str)
ISDIGIT
|
private boolean |
isSpace(int str)
ISSPACE
|
private boolean |
isSpaceOrUnderscore(int str)
ISSPACE || *str == '_'
|
static org.jruby.util.ByteList |
longToBinaryByteList(long i) |
static byte[] |
longToBinaryBytes(long i) |
static byte[] |
longToByteArray(long i,
int radix,
boolean upper) |
static org.jruby.util.ByteList |
longToByteList(long i) |
static org.jruby.util.ByteList |
longToByteList(long i,
int radix) |
static org.jruby.util.ByteList |
longToByteList(long i,
int radix,
byte[] digitmap) |
static byte[] |
longToCharBytes(long i) |
static org.jruby.util.ByteList |
longToHexByteList(long i) |
static org.jruby.util.ByteList |
longToHexByteList(long i,
boolean upper) |
static byte[] |
longToHexBytes(long i) |
static byte[] |
longToHexBytes(long i,
boolean upper) |
static org.jruby.util.ByteList |
longToOctalByteList(long i) |
static byte[] |
longToOctalBytes(long i) |
private static org.jruby.util.ByteList |
longToUnsignedByteList(long i,
int shift,
byte[] digitmap) |
private void |
squeezeZeroes() |
private long |
stringToLong(int nptr,
int[] endptr,
int base) |
static byte[] |
twosComplementToBinaryBytes(byte[] in) |
static byte[] |
twosComplementToHexBytes(byte[] in,
boolean upper) |
static byte[] |
twosComplementToOctalBytes(byte[] in) |
static byte[] |
twosComplementToUnsignedBytes(byte[] in,
int shift,
boolean upper) |
private final Ruby runtime
private final org.jruby.util.ByteList _str
private int str
private int end
private byte[] data
private int base
private final boolean badcheck
private final boolean is19
private static final byte[] ZERO_BYTES
private static final byte[][] MIN_VALUE_BYTES
private static final byte[] LOWER_DIGITS
private static final byte[] UPPER_DIGITS
private static final byte[] conv_digit
private static final boolean[] digit
private static final boolean[] space
private static final boolean[] spaceOrUnderscore
public ConvertBytes(Ruby runtime, org.jruby.util.ByteList _str, int base, boolean badcheck)
public ConvertBytes(Ruby runtime, org.jruby.util.ByteList _str, int base, boolean badcheck, boolean is19)
public static final byte[] intToBinaryBytes(int i)
public static final byte[] intToOctalBytes(int i)
public static final byte[] intToHexBytes(int i)
public static final byte[] intToHexBytes(int i,
boolean upper)
public static final org.jruby.util.ByteList intToBinaryByteList(int i)
public static final org.jruby.util.ByteList intToOctalByteList(int i)
public static final org.jruby.util.ByteList intToHexByteList(int i)
public static final org.jruby.util.ByteList intToHexByteList(int i,
boolean upper)
public static final byte[] intToByteArray(int i,
int radix,
boolean upper)
public static final byte[] intToCharBytes(int i)
public static final byte[] longToBinaryBytes(long i)
public static final byte[] longToOctalBytes(long i)
public static final byte[] longToHexBytes(long i)
public static final byte[] longToHexBytes(long i,
boolean upper)
public static final org.jruby.util.ByteList longToBinaryByteList(long i)
public static final org.jruby.util.ByteList longToOctalByteList(long i)
public static final org.jruby.util.ByteList longToHexByteList(long i)
public static final org.jruby.util.ByteList longToHexByteList(long i,
boolean upper)
public static final byte[] longToByteArray(long i,
int radix,
boolean upper)
public static final byte[] longToCharBytes(long i)
public static final org.jruby.util.ByteList longToByteList(long i)
public static final org.jruby.util.ByteList longToByteList(long i,
int radix)
public static final org.jruby.util.ByteList longToByteList(long i,
int radix,
byte[] digitmap)
private static final org.jruby.util.ByteList intToUnsignedByteList(int i,
int shift,
byte[] digitmap)
private static final org.jruby.util.ByteList longToUnsignedByteList(long i,
int shift,
byte[] digitmap)
public static final byte[] twosComplementToBinaryBytes(byte[] in)
public static final byte[] twosComplementToOctalBytes(byte[] in)
public static final byte[] twosComplementToHexBytes(byte[] in,
boolean upper)
public static final byte[] twosComplementToUnsignedBytes(byte[] in,
int shift,
boolean upper)
public static RubyInteger byteListToInum(Ruby runtime, org.jruby.util.ByteList str, int base, boolean badcheck)
public static RubyInteger byteListToInum19(Ruby runtime, org.jruby.util.ByteList str, int base, boolean badcheck)
public static byte[] bytesToUUIDBytes(byte[] randBytes,
boolean upper)
private byte convertDigit(byte c)
private boolean isSpace(int str)
private boolean isDigit(byte[] buf,
int str)
private boolean isSpaceOrUnderscore(int str)
private boolean getSign()
private void ignoreLeadingWhitespace()
private void figureOutBase()
private int calculateLength()
private void squeezeZeroes()
private long stringToLong(int nptr,
int[] endptr,
int base)
public RubyInteger byteListToInum()
private RubyInteger bigParse(int len, boolean sign)
private void invalidString(java.lang.String type)