Merge pull request #124 from GeMotionX/patch-6

delete useless code
This commit is contained in:
Mariotaku 2015-04-14 12:13:18 +08:00
commit 0148436e1b
1 changed files with 0 additions and 33 deletions

View File

@ -1,33 +0,0 @@
package edu.tsinghua.spice.Utilies;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
/**
* Created by Denny C. Ng on 2/20/15.
*/
public class SpiceIOUtil {
public static byte[] readFile(String file) throws IOException {
return readFile(new File(file));
}
public static byte[] readFile(File file) throws IOException {
// Open file
RandomAccessFile f = new RandomAccessFile(file, "r");
try {
// Get and check length
long longlength = f.length();
int length = (int) longlength;
if (length != longlength)
throw new IOException("File size >= 2 GB");
// Read file and return data
byte[] data = new byte[length];
f.readFully(data);
return data;
} finally {
f.close();
}
}
}