add exception handling

This commit is contained in:
mila@ringwald.ch 2014-12-09 23:15:33 +00:00
parent 46f44c4421
commit a196831f1a

View File

@ -154,6 +154,11 @@ public class Util {
public static String getText(byte[] buffer, int offset, int length){ public static String getText(byte[] buffer, int offset, int length){
byte [] byteData = getBytes(buffer, offset, length); byte [] byteData = getBytes(buffer, offset, length);
return new String(byteData, "UTF-8"); try {
return new String(byteData, "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return "";
} }
} }