summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes
diff options
context:
space:
mode:
authorJulien Gouesse <[email protected]>2015-08-09 17:57:18 +0200
committerJulien Gouesse <[email protected]>2015-08-09 17:57:18 +0200
commit0608e185b3147c28d29b02af58205e639adf3f4e (patch)
treea82ae7ca11f1fb8057046afb048c2aacae5b4297 /src/jogl/classes
parent354f239a461ea2f5ddd494810252216014f9b90b (diff)
Documents ImageIOUtil, see the bug report 1042
Diffstat (limited to 'src/jogl/classes')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/texture/ImageIOUtil.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/ImageIOUtil.java b/src/jogl/classes/com/jogamp/opengl/util/texture/ImageIOUtil.java
index e9e339a0c..1e50f843d 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/ImageIOUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/ImageIOUtil.java
@@ -37,6 +37,15 @@ import java.io.InputStream;
*/
public class ImageIOUtil {
+ /**
+ * 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 of 32 bytes
+ * of read-ahead.
+ *
+ * @param stream stream to check
+ * @return the file suffix if any, otherwise <code>null</code>
+ * @throws java.io.IOException if an I/O exception occurred
+ */
public static String getFileSuffix(InputStream stream) throws IOException {
if (stream == null) {
throw new IOException("Stream was null");
@@ -61,6 +70,14 @@ public class ImageIOUtil {
}
+ /**
+ * Determines the file suffix (i.e the image format) of the given bytes from the header
+ * of a file.
+ *
+ * @param stream stream to check
+ * @return the file suffix if any, otherwise <code>null</code>
+ * @throws java.io.IOException if an I/O exception occurred
+ */
public static String getFileSuffix(final byte[] b) {
/**
* http://www.faqs.org/faqs/jpeg-faq/part1/