Class MagicNumberRegistryEntry.MagicNumber
java.lang.Object
org.apache.batik.ext.awt.image.spi.MagicNumberRegistryEntry.MagicNumber
- Enclosing class:
- MagicNumberRegistryEntry
Inner class that represents one magic number. Simply consists
of an offset in bytes from the start of the file, and a byte
array that must match.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) byte[]
(package private) byte[]
(package private) int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) int
Returns the maximum number of bytes that will be read for this magic number comparison.(package private) boolean
isMatch
(InputStream is) Performs the check of is.
-
Field Details
-
offset
int offset -
magicNumber
byte[] magicNumber -
buffer
byte[] buffer
-
-
Constructor Details
-
MagicNumber
public MagicNumber(int offset, byte[] magicNumber) Constructor.- Parameters:
offset
- the location of the magic number in file.magicNumber
- the sequence of bytes that must match.
-
-
Method Details
-
getReadlimit
int getReadlimit()Returns the maximum number of bytes that will be read for this magic number comparison. -
isMatch
Performs the check of is.- Throws:
StreamCorruptedException
-