mirror of
https://github.com/czp3009/bilibili-api.git
synced 2024-12-21 20:30:28 +08:00
尽量使用接口
This commit is contained in:
parent
6d92145969
commit
a3c43f4fc0
@ -24,7 +24,6 @@ import retrofit2.Call;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
@ -181,7 +180,7 @@ public class LiveClient {
|
||||
return this;
|
||||
}
|
||||
|
||||
public LiveClient registerListeners(@Nonnull List<Object> objects) {
|
||||
public LiveClient registerListeners(@Nonnull Iterable<Object> objects) {
|
||||
objects.forEach(eventBus::register);
|
||||
return this;
|
||||
}
|
||||
@ -191,7 +190,7 @@ public class LiveClient {
|
||||
return this;
|
||||
}
|
||||
|
||||
public LiveClient unregisterListeners(@Nonnull List<Object> objects) {
|
||||
public LiveClient unregisterListeners(@Nonnull Iterable<Object> objects) {
|
||||
objects.forEach(eventBus::unregister);
|
||||
return this;
|
||||
}
|
||||
|
@ -2,13 +2,13 @@ package com.hiczp.bilibili.api.live.socket;
|
||||
|
||||
/**
|
||||
* 数据包结构说明
|
||||
* 00 00 00 28 00 10 00 00 00 00 00 07 00 00 00 00
|
||||
* 00 00 00 28/00 10/00 00 00 00 00 07/00 00 00 00
|
||||
* 1-4 字节: 数据包长度
|
||||
* 5-6 字节: 协议头长度, 固定值 0x10
|
||||
* 7-8 字节: 设备类型, Android 固定为 0
|
||||
* 9-12 字节: 数据包类型
|
||||
* 13-16 字节: 设备类型, 同 7-8 字节
|
||||
* 之后的字节为数据包正文, 大多数情况下为 JSON
|
||||
*/
|
||||
public class Package {
|
||||
public static final short LENGTH_FIELD_LENGTH = 4;
|
||||
|
Loading…
Reference in New Issue
Block a user