public class MagicFileNumberTest extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MagicFileNumberTest.Type |
| Modifier and Type | Method and Description |
|---|---|
static void |
addType(String fileSuffix,
byte[] magicBytes) |
static String |
guessFileSuffix(byte[] data) |
static String |
guessFileSuffix(IRandomAccess data) |
static boolean |
isText(byte[] data)
does the data contain only ISO-8819-x printable characters ?
|
static boolean |
isText(IRandomAccess data)
does the data contain only ISO-8819-x printable characters ?
|
public static void addType(String fileSuffix, byte[] magicBytes)
fileSuffix - just the suffix without any starting suffix delimiters (e.g.:
'pdf')magicBytes - any bytes, not null or zero sizepublic static String guessFileSuffix(byte[] data)
data - any not null or zero size datanullpublic static String guessFileSuffix(IRandomAccess data) throws IOException
data - any not null or zero size datanullIOExceptionpublic static boolean isText(byte[] data)
public static boolean isText(IRandomAccess data) throws IOException
IOExceptionCopyright © 2013 intarsys consulting GmbH. All Rights Reserved.