19 lines
498 B
Java
19 lines
498 B
Java
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();
|
|
}
|
|
}
|