onEnable 之前加载插件

修复 NoClassDefFoundError 的问题
This commit is contained in:
Izzel_Aliz
2018-04-21 13:58:56 +08:00
parent b941cac63f
commit 2edca32b89
8 changed files with 135 additions and 40 deletions

View File

@@ -0,0 +1,18 @@
package com.ilummc.tlib.util;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
public class IO {
public static byte[] readFully(InputStream inputStream) throws IOException {
ByteArrayOutputStream stream = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
int len = 0;
while ((len = inputStream.read(buf)) > 0) {
stream.write(buf, 0, len);
}
return stream.toByteArray();
}
}