Convert byte[] to char[] manually since IBM437 isn't available on some platforms

This commit is contained in:
Cameron Gutman 2014-05-07 00:22:32 -04:00
parent 5f93d55dab
commit eaa08bada4

View File

@ -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) {