test_class.file: core/src/test/java/org/ulordj/core/UtilsTest.java
test_class.identifier: UtilsTest
test_case.body: @Test
      public void bigIntegerToBytes_convertZero() {
          BigInteger b = BigInteger.valueOf(0);
          byte[] expected = new byte[]{0b0000_0000};
          byte[] actual = Utils.bigIntegerToBytes(b, 1);
          assertTrue(Arrays.equals(expected, actual));
      }
test_case.class_method_signature: UtilsTest.bigIntegerToBytes_convertZero()
test_case.full_signature: @Test public void bigIntegerToBytes_convertZero()
test_case.identifier: bigIntegerToBytes_convertZero
test_case.invocations: valueOf bigIntegerToBytes assertTrue equals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void bigIntegerToBytes_convertZero()
focal_class.declarator: SPACE_JOINER = Joiner.on(" ")
focal_class.modifier: public static final
focal_class.original_string: public static final Joiner SPACE_JOINER = Joiner.on(" ");
focal_class.type: Joiner
focal_class.var_name: SPACE_JOINER
focal_class.declarator: HEX = BaseEncoding.base16().lowerCase()
focal_class.modifier: public static final
focal_class.original_string: public static final BaseEncoding HEX = BaseEncoding.base16().lowerCase();
focal_class.type: BaseEncoding
focal_class.var_name: HEX
focal_class.declarator: mockSleepQueue
focal_class.modifier: private static
focal_class.original_string: private static BlockingQueue<Boolean> mockSleepQueue;
focal_class.type: BlockingQueue<Boolean>
focal_class.var_name: mockSleepQueue
focal_class.declarator: mockTime
focal_class.modifier: public static volatile
focal_class.original_string: public static volatile Date mockTime;
focal_class.type: Date
focal_class.var_name: mockTime
focal_class.declarator: UTC = TimeZone.getTimeZone("UTC")
focal_class.modifier: private static final
focal_class.original_string: private static final TimeZone UTC = TimeZone.getTimeZone("UTC");
focal_class.type: TimeZone
focal_class.var_name: UTC
focal_class.declarator: bitMask = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80}
focal_class.modifier: private static final
focal_class.original_string: private static final int[] bitMask = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
focal_class.type: int[]
focal_class.var_name: bitMask
focal_class.declarator: isAndroid = -1
focal_class.modifier: private static
focal_class.original_string: private static int isAndroid = -1;
focal_class.type: int
focal_class.var_name: isAndroid
focal_class.file: core/src/main/java/org/ulordj/core/Utils.java
focal_class.identifier: Utils
focal_class.class_method_signature: Utils.bigIntegerToBytes(BigInteger b, int numBytes)
focal_class.full_signature: public static byte[] bigIntegerToBytes(BigInteger b, int numBytes)
focal_class.identifier: bigIntegerToBytes
focal_class.modifiers: public static
focal_class.parameters: (BigInteger b, int numBytes)
focal_class.return: byte[]
focal_class.signature: byte[] bigIntegerToBytes(BigInteger b, int numBytes)
focal_class.class_method_signature: Utils.uint16ToByteArrayLE(int val, byte[] out, int offset)
focal_class.full_signature: public static void uint16ToByteArrayLE(int val, byte[] out, int offset)
focal_class.identifier: uint16ToByteArrayLE
focal_class.modifiers: public static
focal_class.parameters: (int val, byte[] out, int offset)
focal_class.return: void
focal_class.signature: void uint16ToByteArrayLE(int val, byte[] out, int offset)
focal_class.class_method_signature: Utils.uint32ToByteArrayLE(long val, byte[] out, int offset)
focal_class.full_signature: public static void uint32ToByteArrayLE(long val, byte[] out, int offset)
focal_class.identifier: uint32ToByteArrayLE
focal_class.modifiers: public static
focal_class.parameters: (long val, byte[] out, int offset)
focal_class.return: void
focal_class.signature: void uint32ToByteArrayLE(long val, byte[] out, int offset)
focal_class.class_method_signature: Utils.uint32ToByteArrayBE(long val, byte[] out, int offset)
focal_class.full_signature: public static void uint32ToByteArrayBE(long val, byte[] out, int offset)
focal_class.identifier: uint32ToByteArrayBE
focal_class.modifiers: public static
focal_class.parameters: (long val, byte[] out, int offset)
focal_class.return: void
focal_class.signature: void uint32ToByteArrayBE(long val, byte[] out, int offset)
focal_class.class_method_signature: Utils.int64ToByteArrayLE(long val, byte[] out, int offset)
focal_class.full_signature: public static void int64ToByteArrayLE(long val, byte[] out, int offset)
focal_class.identifier: int64ToByteArrayLE
focal_class.modifiers: public static
focal_class.parameters: (long val, byte[] out, int offset)
focal_class.return: void
focal_class.signature: void int64ToByteArrayLE(long val, byte[] out, int offset)
focal_class.class_method_signature: Utils.uint16ToByteStreamLE(int val, OutputStream stream)
focal_class.full_signature: public static void uint16ToByteStreamLE(int val, OutputStream stream)
focal_class.identifier: uint16ToByteStreamLE
focal_class.modifiers: public static
focal_class.parameters: (int val, OutputStream stream)
focal_class.return: void
focal_class.signature: void uint16ToByteStreamLE(int val, OutputStream stream)
focal_class.class_method_signature: Utils.uint16ToByteStreamBE(int val, OutputStream stream)
focal_class.full_signature: public static void uint16ToByteStreamBE(int val, OutputStream stream)
focal_class.identifier: uint16ToByteStreamBE
focal_class.modifiers: public static
focal_class.parameters: (int val, OutputStream stream)
focal_class.return: void
focal_class.signature: void uint16ToByteStreamBE(int val, OutputStream stream)
focal_class.class_method_signature: Utils.uint32ToByteStreamLE(long val, OutputStream stream)
focal_class.full_signature: public static void uint32ToByteStreamLE(long val, OutputStream stream)
focal_class.identifier: uint32ToByteStreamLE
focal_class.modifiers: public static
focal_class.parameters: (long val, OutputStream stream)
focal_class.return: void
focal_class.signature: void uint32ToByteStreamLE(long val, OutputStream stream)
focal_class.class_method_signature: Utils.uint32ToByteStreamBE(long val, OutputStream stream)
focal_class.full_signature: public static void uint32ToByteStreamBE(long val, OutputStream stream)
focal_class.identifier: uint32ToByteStreamBE
focal_class.modifiers: public static
focal_class.parameters: (long val, OutputStream stream)
focal_class.return: void
focal_class.signature: void uint32ToByteStreamBE(long val, OutputStream stream)
focal_class.class_method_signature: Utils.int64ToByteStreamLE(long val, OutputStream stream)
focal_class.full_signature: public static void int64ToByteStreamLE(long val, OutputStream stream)
focal_class.identifier: int64ToByteStreamLE
focal_class.modifiers: public static
focal_class.parameters: (long val, OutputStream stream)
focal_class.return: void
focal_class.signature: void int64ToByteStreamLE(long val, OutputStream stream)
focal_class.class_method_signature: Utils.uint256ToByteStreamLE(BigInteger val, OutputStream stream)
focal_class.full_signature: public static void uint256ToByteStreamLE(BigInteger val, OutputStream stream)
focal_class.identifier: uint256ToByteStreamLE
focal_class.modifiers: public static
focal_class.parameters: (BigInteger val, OutputStream stream)
focal_class.return: void
focal_class.signature: void uint256ToByteStreamLE(BigInteger val, OutputStream stream)
focal_class.class_method_signature: Utils.uint64ToByteStreamLE(BigInteger val, OutputStream stream)
focal_class.full_signature: public static void uint64ToByteStreamLE(BigInteger val, OutputStream stream)
focal_class.identifier: uint64ToByteStreamLE
focal_class.modifiers: public static
focal_class.parameters: (BigInteger val, OutputStream stream)
focal_class.return: void
focal_class.signature: void uint64ToByteStreamLE(BigInteger val, OutputStream stream)
focal_class.class_method_signature: Utils.readUint16(byte[] bytes, int offset)
focal_class.full_signature: public static int readUint16(byte[] bytes, int offset)
focal_class.identifier: readUint16
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes, int offset)
focal_class.return: int
focal_class.signature: int readUint16(byte[] bytes, int offset)
focal_class.class_method_signature: Utils.readUint32(byte[] bytes, int offset)
focal_class.full_signature: public static long readUint32(byte[] bytes, int offset)
focal_class.identifier: readUint32
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes, int offset)
focal_class.return: long
focal_class.signature: long readUint32(byte[] bytes, int offset)
focal_class.class_method_signature: Utils.readInt64(byte[] bytes, int offset)
focal_class.full_signature: public static long readInt64(byte[] bytes, int offset)
focal_class.identifier: readInt64
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes, int offset)
focal_class.return: long
focal_class.signature: long readInt64(byte[] bytes, int offset)
focal_class.class_method_signature: Utils.readUint256(byte[] bytes, int offset)
focal_class.full_signature: public static BigInteger readUint256(byte[] bytes, int offset)
focal_class.identifier: readUint256
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes, int offset)
focal_class.return: BigInteger
focal_class.signature: BigInteger readUint256(byte[] bytes, int offset)
focal_class.class_method_signature: Utils.readUint32BE(byte[] bytes, int offset)
focal_class.full_signature: public static long readUint32BE(byte[] bytes, int offset)
focal_class.identifier: readUint32BE
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes, int offset)
focal_class.return: long
focal_class.signature: long readUint32BE(byte[] bytes, int offset)
focal_class.class_method_signature: Utils.readUint16BE(byte[] bytes, int offset)
focal_class.full_signature: public static int readUint16BE(byte[] bytes, int offset)
focal_class.identifier: readUint16BE
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes, int offset)
focal_class.return: int
focal_class.signature: int readUint16BE(byte[] bytes, int offset)
focal_class.class_method_signature: Utils.readUint16FromStream(InputStream is)
focal_class.full_signature: public static int readUint16FromStream(InputStream is)
focal_class.identifier: readUint16FromStream
focal_class.modifiers: public static
focal_class.parameters: (InputStream is)
focal_class.return: int
focal_class.signature: int readUint16FromStream(InputStream is)
focal_class.class_method_signature: Utils.readUint32FromStream(InputStream is)
focal_class.full_signature: public static long readUint32FromStream(InputStream is)
focal_class.identifier: readUint32FromStream
focal_class.modifiers: public static
focal_class.parameters: (InputStream is)
focal_class.return: long
focal_class.signature: long readUint32FromStream(InputStream is)
focal_class.class_method_signature: Utils.reverseBytes(byte[] bytes)
focal_class.full_signature: public static byte[] reverseBytes(byte[] bytes)
focal_class.identifier: reverseBytes
focal_class.modifiers: public static
focal_class.parameters: (byte[] bytes)
focal_class.return: byte[]
focal_class.signature: byte[] reverseBytes(byte[] bytes)
focal_class.class_method_signature: Utils.sha256hash160(byte[] input)
focal_class.full_signature: public static byte[] sha256hash160(byte[] input)
focal_class.identifier: sha256hash160
focal_class.modifiers: public static
focal_class.parameters: (byte[] input)
focal_class.return: byte[]
focal_class.signature: byte[] sha256hash160(byte[] input)
focal_class.class_method_signature: Utils.decodeMPI(byte[] mpi, boolean hasLength)
focal_class.full_signature: public static BigInteger decodeMPI(byte[] mpi, boolean hasLength)
focal_class.identifier: decodeMPI
focal_class.modifiers: public static
focal_class.parameters: (byte[] mpi, boolean hasLength)
focal_class.return: BigInteger
focal_class.signature: BigInteger decodeMPI(byte[] mpi, boolean hasLength)
focal_class.class_method_signature: Utils.encodeMPI(BigInteger value, boolean includeLength)
focal_class.full_signature: public static byte[] encodeMPI(BigInteger value, boolean includeLength)
focal_class.identifier: encodeMPI
focal_class.modifiers: public static
focal_class.parameters: (BigInteger value, boolean includeLength)
focal_class.return: byte[]
focal_class.signature: byte[] encodeMPI(BigInteger value, boolean includeLength)
focal_class.class_method_signature: Utils.decodeCompactBits(long compact)
focal_class.full_signature: public static BigInteger decodeCompactBits(long compact)
focal_class.identifier: decodeCompactBits
focal_class.modifiers: public static
focal_class.parameters: (long compact)
focal_class.return: BigInteger
focal_class.signature: BigInteger decodeCompactBits(long compact)
focal_class.class_method_signature: Utils.encodeCompactBits(BigInteger value)
focal_class.full_signature: public static long encodeCompactBits(BigInteger value)
focal_class.identifier: encodeCompactBits
focal_class.modifiers: public static
focal_class.parameters: (BigInteger value)
focal_class.return: long
focal_class.signature: long encodeCompactBits(BigInteger value)
focal_class.class_method_signature: Utils.rollMockClock(int seconds)
focal_class.full_signature: public static Date rollMockClock(int seconds)
focal_class.identifier: rollMockClock
focal_class.modifiers: public static
focal_class.parameters: (int seconds)
focal_class.return: Date
focal_class.signature: Date rollMockClock(int seconds)
focal_class.class_method_signature: Utils.rollMockClockMillis(long millis)
focal_class.full_signature: public static Date rollMockClockMillis(long millis)
focal_class.identifier: rollMockClockMillis
focal_class.modifiers: public static
focal_class.parameters: (long millis)
focal_class.return: Date
focal_class.signature: Date rollMockClockMillis(long millis)
focal_class.class_method_signature: Utils.setMockClock()
focal_class.full_signature: public static void setMockClock()
focal_class.identifier: setMockClock
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void setMockClock()
focal_class.class_method_signature: Utils.setMockClock(long mockClockSeconds)
focal_class.full_signature: public static void setMockClock(long mockClockSeconds)
focal_class.identifier: setMockClock
focal_class.modifiers: public static
focal_class.parameters: (long mockClockSeconds)
focal_class.return: void
focal_class.signature: void setMockClock(long mockClockSeconds)
focal_class.class_method_signature: Utils.now()
focal_class.full_signature: public static Date now()
focal_class.identifier: now
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: Date
focal_class.signature: Date now()
focal_class.class_method_signature: Utils.currentTimeMillis()
focal_class.full_signature: public static long currentTimeMillis()
focal_class.identifier: currentTimeMillis
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long currentTimeMillis()
focal_class.class_method_signature: Utils.currentTimeSeconds()
focal_class.full_signature: public static long currentTimeSeconds()
focal_class.identifier: currentTimeSeconds
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long currentTimeSeconds()
focal_class.class_method_signature: Utils.dateTimeFormat(Date dateTime)
focal_class.full_signature: public static String dateTimeFormat(Date dateTime)
focal_class.identifier: dateTimeFormat
focal_class.modifiers: public static
focal_class.parameters: (Date dateTime)
focal_class.return: String
focal_class.signature: String dateTimeFormat(Date dateTime)
focal_class.class_method_signature: Utils.dateTimeFormat(long dateTime)
focal_class.full_signature: public static String dateTimeFormat(long dateTime)
focal_class.identifier: dateTimeFormat
focal_class.modifiers: public static
focal_class.parameters: (long dateTime)
focal_class.return: String
focal_class.signature: String dateTimeFormat(long dateTime)
focal_class.class_method_signature: Utils.checkBitLE(byte[] data, int index)
focal_class.full_signature: public static boolean checkBitLE(byte[] data, int index)
focal_class.identifier: checkBitLE
focal_class.modifiers: public static
focal_class.parameters: (byte[] data, int index)
focal_class.return: boolean
focal_class.signature: boolean checkBitLE(byte[] data, int index)
focal_class.class_method_signature: Utils.setBitLE(byte[] data, int index)
focal_class.full_signature: public static void setBitLE(byte[] data, int index)
focal_class.identifier: setBitLE
focal_class.modifiers: public static
focal_class.parameters: (byte[] data, int index)
focal_class.return: void
focal_class.signature: void setBitLE(byte[] data, int index)
focal_class.class_method_signature: Utils.sleep(long millis)
focal_class.full_signature: public static void sleep(long millis)
focal_class.identifier: sleep
focal_class.modifiers: public static
focal_class.parameters: (long millis)
focal_class.return: void
focal_class.signature: void sleep(long millis)
focal_class.class_method_signature: Utils.setMockSleep(boolean isEnable)
focal_class.full_signature: public static void setMockSleep(boolean isEnable)
focal_class.identifier: setMockSleep
focal_class.modifiers: public static
focal_class.parameters: (boolean isEnable)
focal_class.return: void
focal_class.signature: void setMockSleep(boolean isEnable)
focal_class.class_method_signature: Utils.passMockSleep()
focal_class.full_signature: public static void passMockSleep()
focal_class.identifier: passMockSleep
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void passMockSleep()
focal_class.class_method_signature: Utils.finishMockSleep()
focal_class.full_signature: public static void finishMockSleep()
focal_class.identifier: finishMockSleep
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void finishMockSleep()
focal_class.class_method_signature: Utils.maxOfMostFreq(int... items)
focal_class.full_signature: public static int maxOfMostFreq(int... items)
focal_class.identifier: maxOfMostFreq
focal_class.modifiers: public static
focal_class.parameters: (int... items)
focal_class.return: int
focal_class.signature: int maxOfMostFreq(int... items)
focal_class.class_method_signature: Utils.maxOfMostFreq(List<Integer> items)
focal_class.full_signature: public static int maxOfMostFreq(List<Integer> items)
focal_class.identifier: maxOfMostFreq
focal_class.modifiers: public static
focal_class.parameters: (List<Integer> items)
focal_class.return: int
focal_class.signature: int maxOfMostFreq(List<Integer> items)
focal_class.class_method_signature: Utils.isAndroidRuntime()
focal_class.full_signature: public static boolean isAndroidRuntime()
focal_class.identifier: isAndroidRuntime
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isAndroidRuntime()
focal_class.class_method_signature: Utils.isLinux()
focal_class.full_signature: public static boolean isLinux()
focal_class.identifier: isLinux
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isLinux()
focal_class.class_method_signature: Utils.isWindows()
focal_class.full_signature: public static boolean isWindows()
focal_class.identifier: isWindows
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isWindows()
focal_class.class_method_signature: Utils.isMac()
focal_class.full_signature: public static boolean isMac()
focal_class.identifier: isMac
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isMac()
focal_method.body: public static byte[] bigIntegerToBytes(BigInteger b, int numBytes) {
          checkArgument(b.signum() >= 0, "b must be positive or zero");
          checkArgument(numBytes > 0, "numBytes must be positive");
          byte[] src = b.toByteArray();
          byte[] dest = new byte[numBytes];
          boolean isFirstByteOnlyForSign = src[0] == 0;
          int length = isFirstByteOnlyForSign ? src.length - 1 : src.length;
          checkArgument(length <= numBytes, "The given number does not fit in " + numBytes);
          int srcPos = isFirstByteOnlyForSign ? 1 : 0;
          int destPos = numBytes - length;
          System.arraycopy(src, srcPos, dest, destPos, length);
          return dest;
      }
focal_method.class_method_signature: Utils.bigIntegerToBytes(BigInteger b, int numBytes)
focal_method.full_signature: public static byte[] bigIntegerToBytes(BigInteger b, int numBytes)
focal_method.identifier: bigIntegerToBytes
focal_method.invocations: checkArgument signum checkArgument toByteArray checkArgument arraycopy
focal_method.modifiers: public static
focal_method.parameters: (BigInteger b, int numBytes)
focal_method.return: byte[]
focal_method.signature: byte[] bigIntegerToBytes(BigInteger b, int numBytes)