1. Stream (Java 8): https://gpcoder.com/3923-gioi-thieu-ve-stream-api-trong-java-8/#Gioi_thieuve_Stream_trong_Java_8
2. FileOutputStream
3. ClassLoader
2. FileOutputStream
3. ClassLoader
Java:
ClassLoader classloader = pluginInstance.getClassLoader();
Java:
InputStream resource = classloader.getResourceAsStream("abcxyzjdo.yml");
// Đến đây là bạn có InputStream để đọc file trong jar rồi. Nếu muốn xuất ra thì
// có thể tạo FileOutputStream.
FileOutputStream fileStream = new FileOutputStream(new File(pluginInstance.getDataFolder(), "abcxyzjdo.yml"));
byte[] resourceData = new byte[resource.available()];
resource.read(resourceData);
fileStream.write(resourceData);
// Nhớ đóng stream nếu không sẽ bị exception j đó bruh
fileStream.close();
// ...
