Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.imagero.uio.io
Class JpegFilterInputStream  view JpegFilterInputStream download JpegFilterInputStream.java

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended bycom.imagero.uio.io.JpegFilterInputStream
All Implemented Interfaces:
java.io.Closeable

public class JpegFilterInputStream
extends java.io.FilterInputStream

remove all App blocks from jpeg file
how to use:

 		//read data from file and save filtered data to another file
 		File fs = new File("source.jpg");
 		File fd = new File("dest.jpg");
 		JpegFilterInputStream.filter(fs, fd);

		or

 		//filter data in byte array
 		byte [] source = ...
 		byte [] dest = JpegFilterInputStream.filter(source);

 		or

 		//filter data from InputStream
 		InputStream in;
 		OutputStream out;
 		JpegFilterInputStream.filter(in, out);

      or

      //just wrap InputStream
      JpegFilterInputStream jfis = new JpegFilterInputStream(in);

 


Field Summary
static int[] allMarkers
           
static int APP_0
           
static int APP_1
           
static int APP_10
           
static int APP_11
           
static int APP_12
           
static int APP_13
           
static int APP_14
           
static int APP_15
           
static int APP_2
           
static int APP_3
           
static int APP_4
           
static int APP_5
           
static int APP_6
           
static int APP_7
           
static int APP_8
           
static int APP_9
           
static int[] defaultMarkers
           
private  boolean markerOn
           
(package private)  int[] markers
           
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
JpegFilterInputStream(java.io.InputStream in)
          create JpegFilterInputStream (filter out all markers except App0)
JpegFilterInputStream(java.io.InputStream in, int[] markers)
          create JpegFilterInputStream
 
Method Summary
static byte[] filter(byte[] data)
          filter out all markers (except App0)
static byte[] filter(byte[] data, int[] markers)
           
static void filter(java.io.InputStream in, java.io.OutputStream out)
          filter out all markers (except App0)
static void filter(java.io.InputStream in0, java.io.OutputStream out, int[] markers)
           
static void filterFile(java.io.File src, java.io.File dest)
           
 boolean isAppMarker(int a)
           
 int read()
          Calls the in.read() method
 int read(byte[] b)
          Calls the read(byte[], int, int) overloaded method.
 int read(byte[] b, int off, int len)
          Calls the in.read(byte[], int, int) method.
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APP_0

public static final int APP_0
See Also:
Constant Field Values

APP_1

public static final int APP_1
See Also:
Constant Field Values

APP_2

public static final int APP_2
See Also:
Constant Field Values

APP_3

public static final int APP_3
See Also:
Constant Field Values

APP_4

public static final int APP_4
See Also:
Constant Field Values

APP_5

public static final int APP_5
See Also:
Constant Field Values

APP_6

public static final int APP_6
See Also:
Constant Field Values

APP_7

public static final int APP_7
See Also:
Constant Field Values

APP_8

public static final int APP_8
See Also:
Constant Field Values

APP_9

public static final int APP_9
See Also:
Constant Field Values

APP_10

public static final int APP_10
See Also:
Constant Field Values

APP_11

public static final int APP_11
See Also:
Constant Field Values

APP_12

public static final int APP_12
See Also:
Constant Field Values

APP_13

public static final int APP_13
See Also:
Constant Field Values

APP_14

public static final int APP_14
See Also:
Constant Field Values

APP_15

public static final int APP_15
See Also:
Constant Field Values

allMarkers

public static final int[] allMarkers

defaultMarkers

public static final int[] defaultMarkers

markers

int[] markers

markerOn

private boolean markerOn
Constructor Detail

JpegFilterInputStream

public JpegFilterInputStream(java.io.InputStream in)
create JpegFilterInputStream (filter out all markers except App0)


JpegFilterInputStream

public JpegFilterInputStream(java.io.InputStream in,
                             int[] markers)
create JpegFilterInputStream

Method Detail

filterFile

public static void filterFile(java.io.File src,
                              java.io.File dest)
                       throws java.io.IOException

filter

public static void filter(java.io.InputStream in,
                          java.io.OutputStream out)
                   throws java.io.IOException
filter out all markers (except App0)


filter

public static void filter(java.io.InputStream in0,
                          java.io.OutputStream out,
                          int[] markers)
                   throws java.io.IOException

filter

public static byte[] filter(byte[] data)
                     throws java.io.IOException
filter out all markers (except App0)


filter

public static byte[] filter(byte[] data,
                            int[] markers)
                     throws java.io.IOException

read

public int read()
         throws java.io.IOException
Description copied from class: java.io.FilterInputStream
Calls the in.read() method


read

public int read(byte[] b)
         throws java.io.IOException
Description copied from class: java.io.FilterInputStream
Calls the read(byte[], int, int) overloaded method. Note that this method does not redirect its call directly to a corresponding method in in. This allows subclasses to override only the three argument version of read.


read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Description copied from class: java.io.FilterInputStream
Calls the in.read(byte[], int, int) method.


isAppMarker

public boolean isAppMarker(int a)