delete useless code

delete useless code
This commit is contained in:
Denny C. Ng 2015-04-14 11:46:14 +08:00
parent 668e59f4f2
commit 26a0a006c4
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();
}
}
}