Top Inners Fields Constructors Methods
org.jruby.util

public Class ConvertBytes

extends Object
Class Inheritance
Imports
java.math.BigInteger, java.nio.ByteBuffer, java.util.Arrays, org.jcodings.specific.USASCIIEncoding, org.jruby.*, org.jruby.runtime.builtin.IRubyObject

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final boolean
private int
private int
private static final ByteList[]
private static final byte[]
private byte[]
private static final boolean[]
private int
private static final byte[]
private static final byte[][]
private static final byte[]
public static final int
private final Ruby
private static final boolean[]
private static final boolean[]
private final ByteList
private static final byte[]
private static final byte[]

Constructor Summary

AccessConstructor and Description
public
ConvertBytes(Ruby runtime, ByteList str, int base, boolean badcheck)

pack-priv
ConvertBytes(Ruby runtime, ByteList str, int off, int end, int base, boolean badcheck)

public
ConvertBytes(Ruby runtime, ByteList str, int base, boolean badcheck, boolean is19)
Deprecated

Method Summary

Modifier and TypeMethod and Description
private IRubyObject
bigParse(int len, boolean sign, boolean exception)

public static IRubyObject
byteListToInum(Ruby runtime, ByteList str, int base, boolean badcheck, boolean exception)

rb_cstr_to_inum

public static RubyInteger
byteListToInum(Ruby runtime, ByteList str, int base, boolean badcheck)

public static RubyInteger
byteListToInum(Ruby runtime, ByteList str, int off, int end, int base, boolean badcheck)

public IRubyObject
byteListToInum(boolean exception)

public static byte[]
bytesToUUIDBytes(byte[] randBytes, boolean upper)

public static final ByteList
byteToSharedByteList(short i)

Return a cached ByteList for values -256..255.

private int
private byte
convertDigit(byte c)

conv_digit

private static byte
private void
private boolean
private void
public static final ByteList
public static final byte[]
public static final byte[]
intToByteArray(int i, int radix, boolean upper)

public static final byte[]
public static final ByteList
public static final ByteList
intToHexByteList(int i, boolean upper)

public static final byte[]
public static final byte[]
intToHexBytes(int i, boolean upper)

public static final ByteList
public static final byte[]
private static final ByteList
intToUnsignedByteList(int i, int shift, byte[] digitmap)

private void
invalidString(String type)

rb_invalid_str

private boolean
isSpace(int str)

ISSPACE

public static final void
longIntoString(RubyString string, long i)

public static final void
public static final ByteList
public static final byte[]
public static final byte[]
longToByteArray(long i, int radix, boolean upper)

public static final ByteList
longToByteList(long i)

Produce a new ByteList of the given long as a string in radix 10.

public static final ByteList
longToByteList(long i, int radix)

Produce a new ByteList of the given long as a string in the given radix.

public static final ByteList
longToByteList(long i, int radix, byte[] digitmap)

public 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.

public static final ByteList
public static final byte[]
public static final ByteList
public static final ByteList
longToHexByteList(long i, boolean upper)

public static final byte[]
public static final byte[]
longToHexBytes(long i, boolean upper)

public static final ByteList
public static final byte[]
private static final ByteList
longToUnsignedByteList(long i, int shift, byte[] digitmap)

private static int
sizeWithDecimalString(long i, boolean neg, int baseSize)

private void
private BigInteger
private long
stringToLong(int nptr, int[] endptr, int base)

private int
public static final byte[]
public static final byte[]
twosComplementToHexBytes(byte[] in, boolean upper)

public static final byte[]
public static final byte[]
twosComplementToUnsignedBytes(byte[] in, int shift, boolean upper)

private static void
writeDecimalDigitsToArray(byte[] bytes, long i, boolean negative, int begin, int originalSize, int newSize)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

badcheckback to summary
private final boolean badcheck
baseback to summary
private int base
begback to summary
private int beg
BYTE_RANGE_STRINGSback to summary
private static final ByteList[] BYTE_RANGE_STRINGS
conv_digitback to summary
private static final byte[] conv_digit
databack to summary
private byte[] data
digitback to summary
private static final boolean[] digit
endback to summary
private int end
LOWER_DIGITSback to summary
private static final byte[] LOWER_DIGITS
MIN_VALUE_BYTESback to summary
private static final byte[][] MIN_VALUE_BYTES
MIN_VALUE_BYTES_RADIX_10back to summary
private static final byte[] MIN_VALUE_BYTES_RADIX_10
MIN_VALUE_BYTES_RADIX_10_LENGTHback to summary
public static final int MIN_VALUE_BYTES_RADIX_10_LENGTH
runtimeback to summary
private final Ruby runtime
spaceback to summary
private static final boolean[] space
spaceOrUnderscoreback to summary
private static final boolean[] spaceOrUnderscore
strback to summary
private final ByteList str
UPPER_DIGITSback to summary
private static final byte[] UPPER_DIGITS
ZERO_BYTESback to summary
private static final byte[] ZERO_BYTES

Constructor Detail

ConvertBytesback to summary
public ConvertBytes(Ruby runtime, ByteList str, int base, boolean badcheck)
ConvertBytesback to summary
pack-priv ConvertBytes(Ruby runtime, ByteList str, int off, int end, int base, boolean badcheck)
ConvertBytesback to summary
public ConvertBytes(Ruby runtime, ByteList str, int base, boolean badcheck, boolean is19)

Deprecated

Annotations
@Deprecated

Method Detail

bigParseback to summary
private IRubyObject bigParse(int len, boolean sign, boolean exception)
byteListToInumback to summary
public static IRubyObject byteListToInum(Ruby runtime, ByteList str, int base, boolean badcheck, boolean exception)

rb_cstr_to_inum

byteListToInumback to summary
public static RubyInteger byteListToInum(Ruby runtime, ByteList str, int base, boolean badcheck)
byteListToInumback to summary
public static RubyInteger byteListToInum(Ruby runtime, ByteList str, int off, int end, int base, boolean badcheck)
byteListToInumback to summary
public IRubyObject byteListToInum(boolean exception)
bytesToUUIDBytesback to summary
public static byte[] bytesToUUIDBytes(byte[] randBytes, boolean upper)
byteToSharedByteListback to summary
public static final ByteList byteToSharedByteList(short i)

Return a cached ByteList for values -256..255. Any values outside this range are not cached and use of this method should be guarded appropriately. A short parameter is used to accommodate unsigned byte values 128..255.

calculateLengthback to summary
private int calculateLength()
convertDigitback to summary
private byte convertDigit(byte c)

conv_digit

decimalByteForDigitback to summary
private static byte decimalByteForDigit(long i)
figureOutBaseback to summary
private void figureOutBase()
getSignback to summary
private boolean getSign()
ignoreLeadingWhitespaceback to summary
private void ignoreLeadingWhitespace()
intToBinaryByteListback to summary
public static final ByteList intToBinaryByteList(int i)
intToBinaryBytesback to summary
public static final byte[] intToBinaryBytes(int i)
intToByteArrayback to summary
public static final byte[] intToByteArray(int i, int radix, boolean upper)
intToCharBytesback to summary
public static final byte[] intToCharBytes(int i)
intToHexByteListback to summary
public static final ByteList intToHexByteList(int i)
intToHexByteListback to summary
public static final ByteList intToHexByteList(int i, boolean upper)
intToHexBytesback to summary
public static final byte[] intToHexBytes(int i)
intToHexBytesback to summary
public static final byte[] intToHexBytes(int i, boolean upper)
intToOctalByteListback to summary
public static final ByteList intToOctalByteList(int i)
intToOctalBytesback to summary
public static final byte[] intToOctalBytes(int i)
intToUnsignedByteListback to summary
private static final ByteList intToUnsignedByteList(int i, int shift, byte[] digitmap)
invalidStringback to summary
private void invalidString(String type)

rb_invalid_str

isSpaceback to summary
private boolean isSpace(int str)

ISSPACE

longIntoStringback to summary
public static final void longIntoString(RubyString string, long i)
longIntoStringSimpleback to summary
public static final void longIntoStringSimple(RubyString string, long i)
longToBinaryByteListback to summary
public static final ByteList longToBinaryByteList(long i)
longToBinaryBytesback to summary
public static final byte[] longToBinaryBytes(long i)
longToByteArrayback to summary
public static final byte[] longToByteArray(long i, int radix, boolean upper)
longToByteListback to summary
public static final ByteList longToByteList(long i)

Produce a new ByteList of the given long as a string in radix 10.

longToByteListback to summary
public static final ByteList longToByteList(long i, int radix)

Produce a new ByteList of the given long as a string in the given radix.

longToByteListback to summary
public static final ByteList longToByteList(long i, int radix, byte[] digitmap)
longToByteListCachedback to summary
public 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. The result is suitable for places where transient ByteList are immediately appended into another buffer.

longToByteListSimpleback to summary
public static final ByteList longToByteListSimple(long i)
longToCharBytesback to summary
public static final byte[] longToCharBytes(long i)
longToHexByteListback to summary
public static final ByteList longToHexByteList(long i)
longToHexByteListback to summary
public static final ByteList longToHexByteList(long i, boolean upper)
longToHexBytesback to summary
public static final byte[] longToHexBytes(long i)
longToHexBytesback to summary
public static final byte[] longToHexBytes(long i, boolean upper)
longToOctalByteListback to summary
public static final ByteList longToOctalByteList(long i)
longToOctalBytesback to summary
public static final byte[] longToOctalBytes(long i)
longToUnsignedByteListback to summary
private static final ByteList longToUnsignedByteList(long i, int shift, byte[] digitmap)
sizeWithDecimalStringback to summary
private static int sizeWithDecimalString(long i, boolean neg, int baseSize)
squeezeZeroesback to summary
private void squeezeZeroes()
stringToBigback to summary
private BigInteger stringToBig(String str)
stringToLongback to summary
private long stringToLong(int nptr, int[] endptr, int base)
trailingLengthback to summary
private int trailingLength()
twosComplementToBinaryBytesback to summary
public static final byte[] twosComplementToBinaryBytes(byte[] in)
twosComplementToHexBytesback to summary
public static final byte[] twosComplementToHexBytes(byte[] in, boolean upper)
twosComplementToOctalBytesback to summary
public static final byte[] twosComplementToOctalBytes(byte[] in)
twosComplementToUnsignedBytesback to summary
public static final byte[] twosComplementToUnsignedBytes(byte[] in, int shift, boolean upper)
writeDecimalDigitsToArrayback to summary
private static void writeDecimalDigitsToArray(byte[] bytes, long i, boolean negative, int begin, int originalSize, int newSize)
org.jruby.util back to summary

public Class ConvertBytes.ERange

extends RuntimeException
Class Inheritance

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
private final ConvertBytes.ERange.Kind

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ConvertBytes.ERange.Kind

Field Detail

kindback to summary
private final ConvertBytes.ERange.Kind kind

Constructor Detail

ERangeback to summary
public ERange(ConvertBytes.ERange.Kind kind)

Method Detail

getKindback to summary
public ConvertBytes.ERange.Kind getKind()
org.jruby.util back to summary

public final Enum ConvertBytes.ERange.Kind

extends Enum<ConvertBytes.ERange.Kind>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final ConvertBytes.ERange.Kind
public static final ConvertBytes.ERange.Kind

Constructor Summary

AccessConstructor and Description
private
Kind()

Method Summary

Modifier and TypeMethod and Description
public static ConvertBytes.ERange.Kind
public static ConvertBytes.ERange.Kind[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

Overflowback to summary
public static final ConvertBytes.ERange.Kind Overflow
Underflowback to summary
public static final ConvertBytes.ERange.Kind Underflow

Constructor Detail

Kindback to summary
private Kind()

Method Detail

valueOfback to summary
public static ConvertBytes.ERange.Kind valueOf(String name)
valuesback to summary
public static ConvertBytes.ERange.Kind[] values()