code: public void cancel() {
          try {
              // FileOutputStream is also closed cascadingly
              if (outStream != null) {
                  outStream.close();
                  outStream = null;
              }
              // Clear encryptor:
              encryptor = null;
          } catch (IOException e) {
              Log.w(Log.TAG_BLOB_STORE, "Exception closing buffered output stream", e);
          }
          tempFile.delete();
      }
docs: Call this to cancel before finishing the data.