// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.io.*;

import com.davidjohnburrowes.format.jpeg.JpegData;

public class T2 { 
    public static void main(String[] args) throws Exception { 
        JpegData img = new JpegData();
        RandomAccessFile raf = new RandomAccessFile("before.jpg", "r");
        img.read(raf);
        raf.close();
        FileOutputStream fos = new FileOutputStream("after.jpg");
        img.write(fos);
        fos.close();
    } 
}
