org.mmbase.util
Class IECompatibleJpegInputStream

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended byorg.mmbase.util.IECompatibleJpegInputStream
All Implemented Interfaces:
java.lang.Runnable

public class IECompatibleJpegInputStream
extends java.io.FilterInputStream
implements java.lang.Runnable

IECompatibleJpegInputStream removes additional information left by PhotoShop 7 in jpegs , this information may crash Internet Exploder. that's why you need to remove it. With PS 7, Adobe decided by default to embed XML-encoded "preview" data into JPEG files, using a feature of the JPEG format that permits embedding of arbitrarily-named "profiles". In theory, these files are valid according to the JPEG specifications. However they break many applications, including Quark and, significantly, various versions of Internet Explorer on various platforms.

Since:
MMBase 1.7
Version:
$Id: IECompatibleJpegInputStream.java,v 1.3 2004/04/07 14:11:08 keesj Exp $
Author:
Kees Jongenburger

Field Summary
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
IECompatibleJpegInputStream(java.io.InputStream in)
          create a new InputStream that parse the content of a jpeg file and removes application headers if the content is not a jpeg the content remains unaffected
 
Method Summary
 int available()
           
 void close()
           
static void main(java.lang.String[] argv)
           
static byte[] process(byte[] in)
          Util method that uses the IECompatibleInputStream to convert a byte array if the content is not a jpeg the content is not affected
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 void run()
           
 long skip(long n)
           
 
Methods inherited from class java.io.FilterInputStream
mark, markSupported, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IECompatibleJpegInputStream

public IECompatibleJpegInputStream(java.io.InputStream in)
create a new InputStream that parse the content of a jpeg file and removes application headers if the content is not a jpeg the content remains unaffected

Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

available

public int available()
              throws java.io.IOException
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Throws:
java.io.IOException

read

public int read(byte[] b)
         throws java.io.IOException
Throws:
java.io.IOException

skip

public long skip(long n)
          throws java.io.IOException
Throws:
java.io.IOException

process

public static byte[] process(byte[] in)
Util method that uses the IECompatibleInputStream to convert a byte array if the content is not a jpeg the content is not affected

Parameters:
in - the byte array

main

public static void main(java.lang.String[] argv)
                 throws java.io.IOException
Throws:
java.io.IOException


MMBase build 1.7.1.20041002