hi all,
i know using mosaic can stitch images read from file by adding them to vector, but if i didn't export the bufferedimage to image files, by passing them directly to vector instead, i got vector grows in size and finally got outofmemory error, this maybe because jai load file to renderedimage which point to the image file so it doesn't consume much space. so now the problem is how can i stitch images by not writing tiled images files to disk? here is the code:

Vector renderedOps = new Vector();

RenderedImage op;

for(int y=0;y<ny;y++){

for(int x=0;x<nx;x++){

op = JAI.create("fileload",".//sub tif//"x"_"y".TIF");
op = TranslateDescriptor.create(op,(float)(width),(floa t)(height),null,null);


RenderedOp finalImage = MosaicDescriptor.create((RenderedImage[])renderedOps.toArray(new RenderedOp[renderedOps.size()]),MosaicDescriptor.MOSAIC_TYPE_OVERLAY,null,null,n ull,null,null);

ImageIO.write(finalImage, "TIFF", new File("c:\\out.tif"));

thank you!