public void removeXmpXml(final ByteSource byteSource, final OutputStream os) throws ImagingException, IOException {
        final JFIFPieces jfifPieces = analyzeJfif(byteSource);
        List<JFIFPiece> pieces = jfifPieces.pieces;
        pieces = removeXmpSegments(pieces);
        writeSegments(os, pieces);
    }
Reads a JPEG image, removes all XMP XML (by removing the APP1 segment), and writes the result to a stream.

@param byteSource ByteSource containing JPEG image data.
@param os         OutputStream to write the image to.
@throws ImagingException if it fails to read the JFIF segments
@throws IOException      if it fails to read or write the data from the segments
src/main/java/org/apache/commons/imaging/formats/jpeg/xmp/JpegXmpRewriter.java