public class MagicFileNumberTest
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MagicFileNumberTest.Type |
Modifier and Type | Method and Description |
---|---|
static void |
addType(java.lang.String fileSuffix,
byte[] magicBytes) |
protected static void |
addTypes() |
static java.lang.String |
guessFileSuffix(byte[] data) |
static java.lang.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(java.lang.String fileSuffix, byte[] magicBytes)
fileSuffix
- just the suffix without any starting suffix delimiters (e.g.:
'pdf')magicBytes
- any bytes, not null
or zero sizeprotected static void addTypes()
public static java.lang.String guessFileSuffix(byte[] data)
data
- any not null or zero size datanull
public static java.lang.String guessFileSuffix(IRandomAccess data) throws java.io.IOException
data
- any not null or zero size datanull
java.io.IOException
public static boolean isText(byte[] data)
public static boolean isText(IRandomAccess data) throws java.io.IOException
java.io.IOException