Partager via


ProtectedFileInputStream.create synchronous method

Synchronously creates a ProtectedFileInputStream object from an existing protected file.

Signature

public static ProtectedFileInputStream create(InputStream inputStream,
                                       String userId,
                                       AuthenticationRequestCallback authenticationContext,
                                       ConsentCallback consentCallback,
                                       int policyAcquisitionFlags,
                                       Context applicationContext)
            throws ProtectionException

Parameters

Name Datatype Notes
inputStream
InputStream
input stream with the protected content
userId
String
Optional.
A userId is used for caching a user policy for offline usage. For multiple user scenarios, caller must supply a userId.
If userId is null, then the user policy is cached without userId and is retrievable with null userId as well. A null userId also retrieves any matching offline user policy cached without userId or any userId.
authenticationContext
AuthenticationRequestCallback
consentCallback
ConsentCallback
policyAcquisitionFlags
int
See PolicyAcquisitionFlagss for more information.
applicationContext
Context

Returns

ProtectedFileInputStream

Throws

ProtectionException

Defined in

ProtectedFileInputStream.java

Supported Platforms

Minimum supported OS version
Android 4.0.3 (API level 15)