FileDocCategorySizeDatePackage
Utf8.javaAPI Docmp4parser 1.0-RC-171712Wed Dec 19 20:10:38 GMT 2012com.coremedia.iso

Utf8

public final class Utf8 extends Object
Converts byte[] -> String and vice versa.

Fields Summary
Constructors Summary
Methods Summary
public static byte[]convert(java.lang.String s)

        try {
            if (s != null) {
                return s.getBytes("UTF-8");
            } else {
                return null;
            }
        } catch (UnsupportedEncodingException e) {
            throw new Error(e);
        }
    
public static java.lang.Stringconvert(byte[] b)

        try {
            if (b != null) {
                return new String(b, "UTF-8");
            } else {
                return null;
            }
        } catch (UnsupportedEncodingException e) {
            throw new Error(e);
        }
    
public static intutf8StringLengthInBytes(java.lang.String utf8)

        try {
            if (utf8 != null) {
                return utf8.getBytes("UTF-8").length;
            } else {
                return 0;
            }
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException();
        }