Code example for PipedInputStream

Methods: close

0
 
			if (!mCancelled && imageStream != null) {
				PipedOutputStream out = new PipedOutputStream();
				PipedInputStream inputStream;
				try { 
					inputStream = new PipedInputStream(out);
 
					EncryptionController.runDecryptTask(mFriend.getImageVersion(), IdentityController.getLoggedInUser(),
							mFriend.getImageVersion(), mFriend.getImageIv(), new BufferedInputStream(imageStream), out);
 
					if (mCancelled) {
						inputStream.close();
						return; 
					} 
 
					byte[] bytes = Utils.inputStreamToBytes(inputStream);
					if (mCancelled) {
						return; 
					} 
 
					bitmap = ChatUtils.getSampledImage(bytes);