mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-20 11:33:06 +00:00
Convert byte[] to char[] manually since IBM437 isn't available on some platforms
This commit is contained in:
parent
5f93d55dab
commit
eaa08bada4
@ -1,6 +1,5 @@
|
|||||||
package com.limelight.nvstream.rtsp;
|
package com.limelight.nvstream.rtsp;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.Inet6Address;
|
import java.net.Inet6Address;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
@ -11,9 +10,13 @@ import com.limelight.nvstream.StreamConfiguration;
|
|||||||
|
|
||||||
public class SdpGenerator {
|
public class SdpGenerator {
|
||||||
private static void addSessionAttributeBytes(StringBuilder config, String attribute, byte[] value) {
|
private static void addSessionAttributeBytes(StringBuilder config, String attribute, byte[] value) {
|
||||||
try {
|
char str[] = new char[value.length];
|
||||||
addSessionAttribute(config, attribute, new String(value, "IBM437"));
|
|
||||||
} catch (UnsupportedEncodingException e) {}
|
for (int i = 0; i < value.length; i++) {
|
||||||
|
str[i] = (char)value[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
addSessionAttribute(config, attribute, new String(str));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addSessionAttributeInts(StringBuilder config, String attribute, int[] value) {
|
private static void addSessionAttributeInts(StringBuilder config, String attribute, int[] value) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user