mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-03-02 10:19:40 -05:00
Fix messages
- WebcastSocialMessage - ImDeleteMessage
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package io.github.jwdeveloper.tiktok.common;
|
||||
|
||||
import com.google.protobuf.InvalidProtocolBufferException;
|
||||
import io.github.jwdeveloper.tiktok.messages.WebcastWebsocketMessage;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Base64;
|
||||
|
||||
public class TikTokBaseTest
|
||||
{
|
||||
public byte[] getFileBytes(String path)
|
||||
{
|
||||
try {
|
||||
var stream = getClass().getClassLoader().getResourceAsStream(path);
|
||||
var bytes= stream.readAllBytes();
|
||||
stream.close();
|
||||
return bytes;
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] getFileBytesUtf(String path)
|
||||
{
|
||||
try {
|
||||
var stream = getClass().getClassLoader().getResourceAsStream(path);
|
||||
var bytes= stream.readAllBytes();
|
||||
stream.close();
|
||||
return Base64.getDecoder().decode(bytes);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user