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 voidprotected static voidaddTypes()static StringguessFileSuffix(byte[] data) static StringguessFileSuffix(IRandomAccess data) static booleanisText(byte[] data) does the data contain only ISO-8819-x printable characters ?static booleanisText(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, notnullor 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
-