If given an empty (but not null) byte array to get a whole string from, return an empty string rather than an exception
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@405755 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f80d4eadfa
commit
5d14b4debb
@ -88,6 +88,7 @@ public class StringUtil {
|
||||
*@return the converted string
|
||||
*/
|
||||
public static String getFromUnicodeLE(final byte[] string) {
|
||||
if(string.length == 0) { return ""; }
|
||||
return getFromUnicodeLE(string, 0, string.length / 2);
|
||||
}
|
||||
|
||||
@ -140,6 +141,7 @@ public class StringUtil {
|
||||
*@return the converted string
|
||||
*/
|
||||
public static String getFromUnicodeBE(final byte[] string) {
|
||||
if(string.length == 0) { return ""; }
|
||||
return getFromUnicodeBE(string, 0, string.length / 2);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user