Files
CraftTweaker/MineTweaker3-API/src/main/java/minetweaker/util/FileUtil.java
T
Stan Hebben 2de467d7d8 - Refactored code into different packages
- Fixed some non-static expansion methods
- Fixed scripts not reloading properly
- Implemented mod support build system
- Fixed recipe removal breaking on recipes without predefined output
- Fixed NPE on parsing a bracket expression that doesn't exist - now prints an appropriate error
2014-06-21 18:51:11 +02:00

28 lines
681 B
Java

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package minetweaker.util;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
/**
*
* @author Stan
*/
public class FileUtil {
public static final byte[] read(InputStream input) throws IOException {
ByteArrayOutputStream output = new ByteArrayOutputStream();
byte[] buffer = new byte[65536];
while (input.available() > 0) {
int bytesRead = input.read(buffer);
output.write(buffer, 0, bytesRead);
}
return output.toByteArray();
}
}