01: /******************************************************************************
02: * JPEG.java
03: * ****************************************************************************/package org.openlaszlo.media;
04:
05: import java.io.InputStream;
06: import java.io.IOException;
07: import java.io.DataInputStream;
08:
09: /**
10: * JPEG
11: */
12: public class JPEG {
13:
14: static public boolean is(InputStream str) throws IOException {
15:
16: final short magic = (short) 0xffd8;
17:
18: DataInputStream ds = new DataInputStream(str);
19: return (ds.readShort() == magic);
20: }
21: }
|