Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持ByteArray播放动画 #111

Merged
merged 4 commits into from
Jul 8, 2021
Merged

支持ByteArray播放动画 #111

merged 4 commits into from
Jul 8, 2021

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