Class Utils

java.lang.Object
org.cloudburstmc.server.utils.Utils

public class Utils extends Object
author: MagicDroidX Nukkit Project
  • Field Details

    • REFERENCE_QUEUE

      public static final com.google.common.base.FinalizableReferenceQueue REFERENCE_QUEUE
  • Constructor Details

    • Utils

      public Utils()
  • Method Details

    • addShutdownTask

      public static void addShutdownTask(Runnable runnable)
    • writeFile

      public static void writeFile(String fileName, String content) throws IOException
      Throws:
      IOException
    • writeFile

      public static void writeFile(String fileName, InputStream content) throws IOException
      Throws:
      IOException
    • writeFile

      public static void writeFile(File file, String content) throws IOException
      Throws:
      IOException
    • writeFile

      public static void writeFile(File file, InputStream content) throws IOException
      Throws:
      IOException
    • readFile

      public static String readFile(File file) throws IOException
      Throws:
      IOException
    • readFile

      public static String readFile(String filename) throws IOException
      Throws:
      IOException
    • readFile

      public static String readFile(InputStream inputStream) throws IOException
      Throws:
      IOException
    • copyFile

      public static void copyFile(File from, File to) throws IOException
      Throws:
      IOException
    • getAllThreadDumps

      public static String getAllThreadDumps()
    • getExceptionMessage

      public static String getExceptionMessage(Throwable e)
    • dataToUUID

      public static UUID dataToUUID(String... params)
    • dataToUUID

      public static UUID dataToUUID(byte[]... params)
    • rtrim

      public static String rtrim(String s, char character)
    • isByteArrayEmpty

      public static boolean isByteArrayEmpty(byte[] array)
    • toRGB

      public static long toRGB(byte r, byte g, byte b, byte a)
    • splitArray

      public static Object[][] splitArray(Object[] arrayToSplit, int chunkSize)
    • reverseArray

      public static <T> void reverseArray(T[] data)
    • reverseArray

      public static <T> T[] reverseArray(T[] array, boolean copy)
    • clone2dArray

      public static <T> T[][] clone2dArray(T[][] array)
    • getOrCreate

      public static <T,​ U,​ V> Map<U,​V> getOrCreate(Map<T,​Map<U,​V>> map, T key)
    • toInt

      public static int toInt(Object number)
    • parseHexBinary

      public static byte[] parseHexBinary(String s)
    • TODO

      public static <T> T TODO()
    • getEnumValues

      public static <T extends Enum<T>> T[] getEnumValues(Class<T> value, T... except)
    • finalAccess

      public static void finalAccess(Field field)