Skip to content

支持ByteArray播放动画#111

Merged
hexleo merged 4 commits intoTencent:masterfrom
iostyle:master
Jul 8, 2021
Merged

支持ByteArray播放动画#111
hexleo merged 4 commits intoTencent:masterfrom
iostyle:master

Conversation

@iostyle
Copy link
Contributor

@iostyle iostyle commented Jul 7, 2021

支持ByteArray播放动画,可适用于资源加解密
需要Android6.0+


override fun readAt(position: Long, buffer: ByteArray, offset: Int, size: Int): Int {
var newSize = size
synchronized(bytes) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

能否使用当前class做同步,不要使用可变变量做同步

@RequiresApi(Build.VERSION_CODES.M)
class StreamContainer(val bytes: ByteArray) : IFileContainer {

private var stream: ByteArrayInputStream? = ByteArrayInputStream(bytes)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样创建应该是一定不为空,可以去掉问号
比如:val stream = ByteArrayInputStream(bytes)

@hexleo hexleo merged commit 2aee1bd into Tencent:master Jul 8, 2021
@hexleo
Copy link
Collaborator

hexleo commented Jul 8, 2021

感谢贡献!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants