package uk.co.mmscomputing.imageio.tiff; import java.io.*; public class TIFFSubSamplingOutputStream extends FilterOutputStream{ protected int w,yf,xf; protected byte[] red,green,blue; protected int y,x,col; protected boolean needToFlush; protected int ww; public TIFFSubSamplingOutputStream(OutputStream out,int width,int yf,int xf){ super(out); this.w=width;this.yf=yf;this.xf=xf; y=0;x=0;col=0;needToFlush=false; ww = ((width+xf-1)/xf)*xf; red = new byte[ww*yf]; green = new byte[ww*yf]; blue = new byte[ww*yf]; } protected void writeDataUnits()throws IOException{ for(int x=0;x y="+y+" x="+x+" c="+c); } }catch(Exception e){ e.printStackTrace(); } } }