private static boolean isSilkV3File(String filePath) {
RandomAccessFile rFile = null;
try {
rFile = new RandomAccessFile(filePath, "r");
byte[] bArr = new byte[9];
rFile.seek(1);
rFile.read(bArr, 0, 9);
String headStr = new String(bArr);
if (headStr.endsWith("#!SILK_V3")) {
return true;
}
else {
return false;
}
} catch (Exception e3) {
}
finally {
if(rFile != null) {
try { rFile.close(); } catch (IOException e) { }
}
}
return false;
}
No comments:
Post a Comment