onEnable 之前加载插件
修复 NoClassDefFoundError 的问题
This commit is contained in:
18
src/main/java/com/ilummc/tlib/util/IO.java
Normal file
18
src/main/java/com/ilummc/tlib/util/IO.java
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user