예제 #1
0
 private Pair<File, Long> writePartData(MasterSecret masterSecret, PduPart part)
     throws MmsException {
   try {
     if (part.getData() != null) {
       Log.w(TAG, "Writing part data from buffer");
       return writePartData(masterSecret, part, new ByteArrayInputStream(part.getData()));
     } else if (part.getDataUri() != null) {
       Log.w(TAG, "Writing part data from URI");
       InputStream in = PartAuthority.getPartStream(context, masterSecret, part.getDataUri());
       return writePartData(masterSecret, part, in);
     } else {
       throw new MmsException("Part is empty!");
     }
   } catch (IOException e) {
     throw new MmsException(e);
   }
 }