Class Utils

java.lang.Object
com.alibaba.druid.util.Utils

public class Utils extends Object
  • Field Details

  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • read

      public static String read(InputStream in)
    • readFromResource

      public static String readFromResource(String resource) throws IOException
      Throws:
      IOException
    • readByteArrayFromResource

      public static byte[] readByteArrayFromResource(String resource) throws IOException
      Throws:
      IOException
    • readByteArray

      public static byte[] readByteArray(InputStream input) throws IOException
      Throws:
      IOException
    • copy

      public static long copy(InputStream input, OutputStream output) throws IOException
      Throws:
      IOException
    • read

      public static String read(Reader reader)
    • read

      public static String read(Reader reader, int length)
    • toString

      public static String toString(Date date)
    • getStackTrace

      public static String getStackTrace(Throwable ex)
    • toString

      public static String toString(StackTraceElement[] stackTrace)
    • getBoolean

      public static Boolean getBoolean(Properties properties, String key)
    • getInteger

      public static Integer getInteger(Properties properties, String key)
    • getLong

      public static Long getLong(Properties properties, String key)
    • loadClass

      public static Class<?> loadClass(String className)
    • getStartTime

      public static final Date getStartTime()
    • murmurhash2_64

      public static long murmurhash2_64(String text)
    • murmurhash2_64

      public static long murmurhash2_64(byte[] data, int length, int seed)
      murmur hash 2.0, The murmur hash is a relatively fast hash function from http://murmurhash.googlepages.com/ for platforms with efficient multiplication.
    • md5Bytes

      public static byte[] md5Bytes(String text)
    • md5

      public static String md5(String text)
    • putLong

      public static void putLong(byte[] b, int off, long val)
    • equals

      public static boolean equals(Object a, Object b)
    • hex

      public static String hex(int hash)
    • hex

      public static String hex(long hash)
    • hex_t

      public static String hex_t(long hash)
    • fnv_64

      public static long fnv_64(String input)
    • fnv_64_lower

      public static long fnv_64_lower(String key)
    • fnv_32_lower

      public static long fnv_32_lower(String key)
    • loadFromFile

      public static void loadFromFile(String path, Set<String> set)