public RecordInputStream createDecryptingStream(InputStream original) {String userPassword = Biff8EncryptionKey.getCurrentUserPassword();if (userPassword == null) {userPassword = Decryptor.DEFAULT_PASSWORD;}EncryptionInfo info = _filePassRec.getEncryptionInfo();try {if (!info.getDecryptor().verifyPassword(userPassword)) {throw new EncryptedDocumentException((Decryptor.DEFAULT_PASSWORD.equals(userPassword) ? "Default" : "Supplied")+ " password is invalid for salt/verifier/verifierHash");}} catch (GeneralSecurityException e) {throw new EncryptedDocumentException(e);}return new RecordInputStream(original, info, _initialRecordsSize);}

public RecordInputStream CreateDecryptingStream(Stream original){FilePassRecord fpr = _filePassRec;String userPassword = Biff8EncryptionKey.CurrentUserPassword;Biff8EncryptionKey key;if (userPassword == null){key = Biff8EncryptionKey.Create(fpr.DocId);}else{key = Biff8EncryptionKey.Create(userPassword, fpr.DocId);}if (!key.Validate(fpr.SaltData, fpr.SaltHash)){throw new EncryptedDocumentException((userPassword == null ? "Default" : "Supplied")+ " password is invalid for docId/saltData/saltHash");}return new RecordInputStream(original, key, _InitialRecordsSize);}
