Package com.mku.android.salmonfs.media
Class AesMediaDataSource
- java.lang.Object
-
- MediaDataSource
-
- com.mku.android.salmonfs.media.AesMediaDataSource
-
public class AesMediaDataSource extends MediaDataSource
Seekable source for encrypted media content.
-
-
Constructor Summary
Constructors Constructor Description AesMediaDataSource(Activity activity, AesFile aesFile, int buffers, int bufferSize, int threads, int backOffset)
Construct a seekable source for the android media player from an encrypted file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the source and all associated resources.long
getSize()
Get the content size.int
readAt(long position, byte[] buffer, int offset, int size)
Decrypts and reads the contents of an encrypted file
-
-
-
Constructor Detail
-
AesMediaDataSource
public AesMediaDataSource(Activity activity, AesFile aesFile, int buffers, int bufferSize, int threads, int backOffset) throws java.lang.Exception
Construct a seekable source for the android media player from an encrypted file.- Parameters:
activity
- Activity this data source will be used with. This is usually the activity the MediaPlayer is attached toaesFile
- AesFile that will be used as a sourcebuffers
- The buffersbufferSize
- Buffer sizethreads
- Threads for parallel processingbackOffset
- The backwards offset to use when reading buffers- Throws:
java.lang.Exception
- Thrown if error occured
-
-
Method Detail
-
readAt
public int readAt(long position, byte[] buffer, int offset, int size) throws java.io.IOException
Decrypts and reads the contents of an encrypted file- Parameters:
position
- The source file position the read will start frombuffer
- The buffer that will store the decrypted contentsoffset
- The position on the buffer that the decrypted data will startsize
- The length of the data requested- Throws:
java.io.IOException
-
getSize
public long getSize()
Get the content size.- Returns:
- The size
-
close
public void close() throws java.io.IOException
Close the source and all associated resources.- Throws:
java.io.IOException
- Thrown if error during IO
-
-