public static boolean writeXMPMeta(InputStream inputStream,OutputStream outputStream,XMPMeta meta){
  List<Section> sections=parse(inputStream,false);
  sections=insertXMPSection(sections,meta);
  if (sections == null) {
    return false;
  }
  try {
    writeJpegFile(outputStream,sections);
  }
 catch (  IOException e) {
    Log.d(TAG,"Write to stream failed",e);
    return false;
  }
 finally {
    if (outputStream != null) {
      try {
        outputStream.close();
      }
 catch (      IOException e) {
      }
    }
  }
  return true;
}

public static boolean writeXMPMeta ( InputStream inputStream , OutputStream outputStream , XMPMeta meta ) { List < Section > sections = parse ( inputStream , false ) ; sections = insertXMPSection ( sections , meta ) ; if ( sections == null ) { return false ; } try { writeJpegFile ( outputStream , sections ) ; } catch ( IOException e ) { Log . d ( TAG , "Write to stream failed" , e ) ; return false ; } finally { if ( outputStream != null ) { try { outputStream . close ( ) ; } catch ( IOException e ) { } } } return true ; }
updates a jpeg file from inputstream with xmpmeta to outputstream .
