Package de.intarsys.tools.file
Class MagicFileNumberTest
java.lang.Object
de.intarsys.tools.file.MagicFileNumberTest
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic void
protected static void
addTypes()
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 ?
-
Method Details
-
addType
- Parameters:
fileSuffix
- just the suffix without any starting suffix delimiters (e.g.: 'pdf')magicBytes
- any bytes, notnull
or zero size
-
addTypes
protected static void addTypes() -
guessFileSuffix
- Parameters:
data
- any not null or zero size data- Returns:
- a file suffix without a delimiter (e.g.: 'pdf') or
null
-
guessFileSuffix
- Parameters:
data
- any not null or zero size data- Returns:
- a file suffix without a delimiter (e.g.: 'pdf') or
null
- Throws:
IOException
-
isText
public static boolean isText(byte[] data) does the data contain only ISO-8819-x printable characters ? -
isText
does the data contain only ISO-8819-x printable characters ?- Throws:
IOException
-