Package com.jogamp.opengl.util.texture
Class ImageType.Util
java.lang.Object
com.jogamp.opengl.util.texture.ImageType.Util
- Enclosing class:
- ImageType
Static utility functions for
ImageType
to determine the ImageType.type
.- Since:
- 2.3.2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getFileSuffix
(byte[] b) Determines the file suffix (i.e the image format) of the given bytes from the header of a file.static String
getFileSuffix
(InputStream stream) Determines the file suffix (i.e the image format) of the given InputStream.static String
getFileSuffix
(InputStream stream, byte[] b) Determines the file suffix (i.e the image format) of the given InputStream.
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
getFileSuffix
Determines the file suffix (i.e the image format) of the given InputStream. The given InputStream must return true from markSupported() and support a minimum ofImageType.MAGIC_MAX_SIZE
bytes of read-ahead.- Parameters:
stream
- stream to parse,InputStream.available()
must be ≥ImageType.MAGIC_MAX_SIZE
- Returns:
- the file suffix if any, otherwise
null
- Throws:
IOException
- if an I/O exception occurred
-
getFileSuffix
Determines the file suffix (i.e the image format) of the given InputStream. The given InputStream must return true from markSupported() and support a minimum ofImageType.MAGIC_MAX_SIZE
bytes of read-ahead.- Parameters:
stream
- stream to parse,InputStream.available()
must be ≥ImageType.MAGIC_MAX_SIZE
b
- byte array sink, size must be ≥ImageType.MAGIC_MAX_SIZE
- Returns:
- the file suffix if any, otherwise
null
- Throws:
IOException
- if an I/O exception occurred
-
getFileSuffix
Determines the file suffix (i.e the image format) of the given bytes from the header of a file.- Parameters:
b
- byte array to parse, size must be ≥ImageType.MAGIC_MAX_SIZE
- Returns:
- the file suffix if any, otherwise
null
- Throws:
IOException
- if an I/O exception occurred
-