diff options
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/PgpVerifyTestingHelper.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/PgpVerifyTestingHelper.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/PgpVerifyTestingHelper.java index d5edae5f0..e27ca578d 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/PgpVerifyTestingHelper.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/testsupport/PgpVerifyTestingHelper.java @@ -9,6 +9,7 @@ import org.sufficientlysecure.keychain.pgp.WrappedPublicKeyRing; import org.sufficientlysecure.keychain.provider.ProviderHelper; import org.sufficientlysecure.keychain.util.InputData; +import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; @@ -36,9 +37,11 @@ public class PgpVerifyTestingHelper { } }; - InputStream sampleInput = getClass().getResourceAsStream(testFileName); - assert null != sampleInput; - InputData data = new InputData(sampleInput, 705); + byte[] sampleInputBytes = readFully(getClass().getResourceAsStream(testFileName)); + + InputStream sampleInput = new ByteArrayInputStream(sampleInputBytes); + + InputData data = new InputData(sampleInput, sampleInputBytes.length); OutputStream outStream = new ByteArrayOutputStream(); PgpDecryptVerify verify = new PgpDecryptVerify.Builder(providerHelper, passphraseCache, data, outStream).build(); |