ByteArrayOutputStream baos = new ByteArrayOutputStream();
ModHuffmanOutputStream mhos;
switch(mode){
case compT4MH: mhos = new ModHuffmanOutputStream(baos);break;
case compT4MR: mhos = new ModREADOutputStream(baos,width);break;
case compT6MMR:mhos = new ModModREADOutputStream(baos,width);break;
default: throw new IOException(cn+".writeImage: Internal Error: Unknown compression = "+mode); // Should never get here.
}
copyout(mhos,imgdata,width,height);