Class ConvertBytes

java.lang.Object
org.jruby.util.ConvertBytes

public class ConvertBytes extends Object
  • Field Details

    • runtime

      private final Ruby runtime
    • str

      private final ByteList 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

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

      ConvertBytes(Ruby runtime, ByteList str, int off, int end, int base, boolean badcheck)
    • 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

      public static final ByteList intToBinaryByteList(int i)
    • intToOctalByteList

      public static final ByteList intToOctalByteList(int i)
    • intToHexByteList

      public static final ByteList intToHexByteList(int i)
    • intToHexByteList

      public static final ByteList intToHexByteList(int i, boolean upper)
    • 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

      public static final ByteList longToBinaryByteList(long i)
    • longToOctalByteList

      public static final ByteList longToOctalByteList(long i)
    • longToHexByteList

      public static final ByteList longToHexByteList(long i)
    • longToHexByteList

      public static final ByteList longToHexByteList(long i, boolean upper)
    • longToByteArray

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

      public static final ByteList longToByteList(long i)
    • longToByteList

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

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

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

      public static final ByteList longToByteListSimple(long i)
    • longToCharBytes

      public static final byte[] longToCharBytes(long i)
    • longIntoStringSimple

      public static final void longIntoStringSimple(RubyString string, long i)
    • 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

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

      private static final ByteList longToUnsignedByteList(long i, int shift, byte[] digitmap)
    • 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

      public static RubyInteger byteListToInum(Ruby runtime, ByteList str, int base, boolean badcheck)
    • 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

      public IRubyObject byteListToInum(boolean exception)
    • trailingLength

      private int trailingLength()
    • bigParse

      private IRubyObject bigParse(int len, boolean sign, boolean exception)
    • stringToBig

      private BigInteger stringToBig(String str)
    • invalidString

      private void invalidString(String type)
      rb_invalid_str