public void finish ( ) throws IOException , SymmetricKeyException { if ( outStream != null ) { if ( encryptor != null ) outStream . write ( encryptor . encrypt ( null ) ) ; // FileOutputStream is also closed cascadingly outStream . close ( ) ; outStream = null ; // Only create the key if we got all the data successfully blobKey = new BlobKey ( sha1Digest . digest ( ) ) ; md5DigestResult = md5Digest . digest ( ) ; } }
Call this after all the data has been added .