2021年1月1日星期五

What happens when I try to get the bytes for a String but the conversion from Character to Byte overflows the Integer length?

Given a String of length Integer.MAX_VALUE which contains characters that require more than one byte to represent, such as Chinese ideograms, what result would I get if I executed String.getBytes()? Is there any good way of testing for this type of error?

https://stackoverflow.com/questions/65535585/what-happens-when-i-try-to-get-the-bytes-for-a-string-but-the-conversion-from-ch January 02, 2021 at 10:39AM

没有评论:

发表评论