Class DiskUtil

java.lang.Object
com.kamikazejam.kamicommon.util.DiskUtil

public class DiskUtil extends Object
  • Constructor Details

    • DiskUtil

      public DiskUtil()
  • Method Details

    • readBytes

      public static byte @NotNull [] readBytes(@NotNull @NotNull File file) throws IOException
      Throws:
      IOException
    • writeBytes

      public static void writeBytes(@NotNull @NotNull File file, byte @NotNull [] bytes) throws IOException
      Throws:
      IOException
    • write

      public static void write(@NotNull @NotNull File file, @NotNull @NotNull String content) throws IOException
      Throws:
      IOException
    • read

      @Contract("_ -> new") @NotNull public static @NotNull String read(@NotNull @NotNull File file) throws IOException
      Throws:
      IOException
    • writeCatch

      public static boolean writeCatch(File file, String content)
    • readCatch

      @Contract("null -> null") @Nullable public static @Nullable String readCatch(File file)
    • deleteRecursive

      public static boolean deleteRecursive(@NotNull @NotNull File path) throws FileNotFoundException
      Throws:
      FileNotFoundException
    • utf8

      @Contract(pure=true) public static byte @NotNull [] utf8(@NotNull @NotNull String string)
    • utf8

      @Contract(value="_ -> new", pure=true) @NotNull public static @NotNull String utf8(byte[] bytes)