Class Utils


  • public class Utils
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String endl  
    • Constructor Summary

      Constructors 
      Constructor Description
      Utils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] bigIntegerToBytes​(java.math.BigInteger val, int size, boolean bigEndian)  
      static long byte_swap​(long val, int size)  
      static java.math.BigInteger bytesToBigInteger​(byte[] byteBuf, int size, boolean bigEndian, boolean signed)  
      static long bytesToLong​(byte[] byteBuf, int size, boolean bigEndian)  
      static java.math.BigInteger calc_bigmask​(int size)  
      static long calc_mask​(int size)  
      static java.math.BigInteger convertToSignedValue​(java.math.BigInteger val, int byteSize)  
      static java.math.BigInteger convertToUnsignedValue​(java.math.BigInteger val, int byteSize)  
      static byte[] longToBytes​(long val, int size, boolean bigEndian)  
      static long sign_extend​(long in, int sizein, int sizeout)  
      static boolean signbit_negative​(long val, int size)  
      static long uintb_negate​(long in, int size)  
      static long zzz_sign_extend​(long val, int bit)  
      static long zzz_zero_extend​(long val, int bit)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • endl

        public static final java.lang.String endl
    • Constructor Detail

      • Utils

        public Utils()
    • Method Detail

      • convertToSignedValue

        public static java.math.BigInteger convertToSignedValue​(java.math.BigInteger val,
                                                                int byteSize)
      • convertToUnsignedValue

        public static java.math.BigInteger convertToUnsignedValue​(java.math.BigInteger val,
                                                                  int byteSize)
      • calc_mask

        public static long calc_mask​(int size)
      • calc_bigmask

        public static java.math.BigInteger calc_bigmask​(int size)
      • signbit_negative

        public static boolean signbit_negative​(long val,
                                               int size)
      • uintb_negate

        public static long uintb_negate​(long in,
                                        int size)
      • sign_extend

        public static long sign_extend​(long in,
                                       int sizein,
                                       int sizeout)
      • zzz_sign_extend

        public static long zzz_sign_extend​(long val,
                                           int bit)
      • zzz_zero_extend

        public static long zzz_zero_extend​(long val,
                                           int bit)
      • byte_swap

        public static long byte_swap​(long val,
                                     int size)
      • bytesToLong

        public static long bytesToLong​(byte[] byteBuf,
                                       int size,
                                       boolean bigEndian)
      • longToBytes

        public static byte[] longToBytes​(long val,
                                         int size,
                                         boolean bigEndian)
      • bytesToBigInteger

        public static java.math.BigInteger bytesToBigInteger​(byte[] byteBuf,
                                                             int size,
                                                             boolean bigEndian,
                                                             boolean signed)
      • bigIntegerToBytes

        public static byte[] bigIntegerToBytes​(java.math.BigInteger val,
                                               int size,
                                               boolean bigEndian)