public class JPEG2000Matcher extends Object
Constructor and Description |
---|
JPEG2000Matcher() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isCodestream(ImageInputStream input)
This function determines if the given stream starts with a valid codestream header.
|
static boolean |
isFileFormat(ImageInputStream input)
This function determines if the given stream starts with a valid JP2 or JPX file format header.
|
static boolean |
matches(Object source)
This function determines whether the source is valid input and is JPEG2000-conform.
|
public static boolean matches(Object source) throws IOException
true
the decoder should be able to process the source if it's valid.source
- the input object to be examined.false
if the source is not kind of ImageInputStream
or is identified as non-JPEG2000
data; true
if source was identified as a valid type, and JPEG2000 codestream or JP2/JPX file format.IOException
- if something went wrong while reading the source.isCodestream(ImageInputStream)
,
isFileFormat(ImageInputStream)
public static boolean isCodestream(ImageInputStream input) throws IOException
Marker.SOC
marker's code, the second two bytes are compared to Marker.SIZ
.
After all, the function resets the position to the initial one.input
- the input to be examined.false
if the input is not a JPEG2000 codestream;true
if input was identified
as a JPEG2000 codestream.IOException
- if something went wrong while reading the source.public static boolean isFileFormat(ImageInputStream input) throws IOException
input
- the input to be examined.false
if the input is not JP2 or JPX file format.true
if input was identified as a JP2 or JPX file format.IOException
Copyright © 2024 levigo holding gmbh. All rights reserved.