Package com.jogamp.opengl.util.texture
Class ImageType.Util
- java.lang.Object
-
- com.jogamp.opengl.util.texture.ImageType.Util
-
- Enclosing class:
- ImageType
public static class ImageType.Util extends Object
Static utility functions forImageTypeto determine theImageType.type.- Since:
- 2.3.2
-
-
Constructor Summary
Constructors Constructor Description Util()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetFileSuffix(byte[] b)Determines the file suffix (i.e the image format) of the given bytes from the header of a file.static StringgetFileSuffix(InputStream stream)Determines the file suffix (i.e the image format) of the given InputStream.static StringgetFileSuffix(InputStream stream, byte[] b)Determines the file suffix (i.e the image format) of the given InputStream.
-
-
-
Method Detail
-
getFileSuffix
public static String getFileSuffix(InputStream stream) throws IOException
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_SIZEbytes 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
public static String getFileSuffix(InputStream stream, byte[] b) throws IOException
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_SIZEbytes of read-ahead.- Parameters:
stream- stream to parse,InputStream.available()must be ≥ImageType.MAGIC_MAX_SIZEb- 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
public static String getFileSuffix(byte[] b)
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
-
-