mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
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
9c748bf4bd
commit
eacf24f41b
@ -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…
x
Reference in New Issue
Block a user