package uk.co.mmscomputing.imageio.tiff; import java.io.*; import uk.co.mmscomputing.io.IntFilterInputStream; public class TIFFSubSamplingInputStream extends IntFilterInputStream{ protected int width,yf,xf,positioning; public TIFFSubSamplingInputStream(InputStream in,int width)throws IOException{ super(in);this.width=width; } public TIFFSubSamplingInputStream(InputStream in,int width,int yf,int xf,int positioning)throws IOException{ this(in,width); setSubSampling(yf,xf); setPositioning(positioning); } public void setSubSampling(int yf,int xf){this.yf=yf;this.xf=xf;} public void setPositioning(int positioning){this.positioning=positioning;} // todo. public int read()throws IOException{ throw new IOException(getClass().getName()+".read:\t\nInternal Error: Please use read(int[] buf,int off,int len)."); } protected void readDataUnit(int[] buf, int off,int maxy,int maxx)throws IOException{ int yoff=off; int y=0; while(y=yf)?yf:maxy &(yf-1), ((width-x)>=xf)?xf:width&(xf-1) ); } } return len; } }