public class MagicByteCheck extends Object
| Constructor and Description |
|---|
MagicByteCheck() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
compareFileExtensionWithMagicBytes(File sourceFile)
It checks the magic bytes of the file and compares the extension by magic byte match with the extension in the
file name.
|
static String |
getExtensionByMagicBytes(File file)
Retrieves the file's extension by magic byte detection.
|
public static boolean compareFileExtensionWithMagicBytes(File sourceFile)
sourceFile - the file to checkIllegalArgumentException - if there is any issue reading the filepublic static String getExtensionByMagicBytes(File file)
file - the file to checkIllegalArgumentException - if there is any issue reading the fileCopyright © 2011–2021 aiticon GmbH. All rights reserved.