Class Utils


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

      Constructors 
      Constructor Description
      Utils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] base64Decode​(java.lang.String data)  
      static java.lang.String base64Encode​(byte[] data)  
      static byte[] compress​(byte[] data)  
      static int crc32​(byte[] bytes)  
      static int crc32​(java.lang.String data)  
      static byte[] decode​(byte[] src)  
      static byte[] decompress​(byte[] data)  
      static byte[] encode​(byte[] src)  
      static int getTimestamp()  
      static byte[] hmacSign​(java.lang.String keyString, byte[] msg)  
      static boolean isUUID​(java.lang.String uuid)  
      static byte[] pack​(PackableEx packableEx)  
      static int randomInt()  
      static void unpack​(byte[] data, PackableEx packableEx)  
      • Methods inherited from class java.lang.Object

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

      • Utils

        public Utils()
    • Method Detail

      • encode

        public static byte[] encode​(byte[] src)
      • decode

        public static byte[] decode​(byte[] src)
      • hmacSign

        public static byte[] hmacSign​(java.lang.String keyString,
                                      byte[] msg)
                               throws java.security.InvalidKeyException,
                                      java.security.NoSuchAlgorithmException
        Throws:
        java.security.InvalidKeyException
        java.security.NoSuchAlgorithmException
      • pack

        public static byte[] pack​(PackableEx packableEx)
      • unpack

        public static void unpack​(byte[] data,
                                  PackableEx packableEx)
      • base64Encode

        public static java.lang.String base64Encode​(byte[] data)
      • base64Decode

        public static byte[] base64Decode​(java.lang.String data)
      • crc32

        public static int crc32​(java.lang.String data)
      • crc32

        public static int crc32​(byte[] bytes)
      • getTimestamp

        public static int getTimestamp()
      • randomInt

        public static int randomInt()
      • isUUID

        public static boolean isUUID​(java.lang.String uuid)
      • compress

        public static byte[] compress​(byte[] data)
      • decompress

        public static byte[] decompress​(byte[] data)