Class ConvertBytes

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

public class ConvertBytes extends Object
  • Field Details

    • MIN_VALUE_BYTES_RADIX_10_LENGTH

      public static final int MIN_VALUE_BYTES_RADIX_10_LENGTH
  • Constructor Details

    • ConvertBytes

      public ConvertBytes(Ruby runtime, ByteList str, 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)
      Produce a new ByteList of the given long as a string in radix 10.
      Parameters:
      i -
      Returns:
    • longToByteList

      public static final ByteList longToByteList(long i, int radix)
      Produce a new ByteList of the given long as a string in the given radix.
      Parameters:
      i -
      radix -
      Returns:
    • longToByteListCached

      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.
      Parameters:
      i -
      Returns:
    • byteToSharedByteList

      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.
      Parameters:
      i -
      Returns:
    • 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)
    • 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)
    • bytesToUUIDBytes

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

      public IRubyObject byteListToInum(boolean exception)