import org.apache.commons.codec.Charsets;
import org.apache.poi.POIDataSamples;
+import org.apache.poi.util.TempFile;
import org.junit.Test;
import java.io.BufferedInputStream;
// having a file shorter than 8 bytes previously caused an exception
byte[] data = new byte[] { -1, -40, -1, -32, 0 };
- File file = File.createTempFile("TestFileMagic", ".bin");
+ File file = TempFile.createTempFile("TestFileMagic", ".bin");
try {
try (FileOutputStream fos = new FileOutputStream(file)) {
fos.write(data);
public void testMarkRequired() throws IOException {
byte[] data = new byte[] { -1, -40, -1, -32, 0 };
- File file = File.createTempFile("TestFileMagic", ".bin");
+ File file = TempFile.createTempFile("TestFileMagic", ".bin");
try {
try (FileOutputStream fos = new FileOutputStream(file)) {
fos.write(data);