KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openlaszlo > media > GIF


1 /******************************************************************************
2  * GIF.java
3  * ****************************************************************************/

4
5 /* J_LZ_COPYRIGHT_BEGIN *******************************************************
6 * Copyright 2001-2004 Laszlo Systems, Inc. All Rights Reserved. *
7 * Use is subject to license terms. *
8 * J_LZ_COPYRIGHT_END *********************************************************/

9
10 package org.openlaszlo.media;
11
12 import java.io.InputStream JavaDoc;
13 import java.io.IOException JavaDoc;
14 import java.io.DataInputStream JavaDoc;
15
16 /**
17  * GIF
18  */

19 public class GIF {
20
21     static public boolean is(InputStream JavaDoc str) throws IOException JavaDoc {
22
23         final int magic = 0x47494638; // GIF8
24

25         DataInputStream JavaDoc ds = new DataInputStream JavaDoc(str);
26         return (ds.readInt() == magic);
27     }
28 }
29
Popular Tags