equal
deleted
inserted
replaced
308 } |
308 } |
309 |
309 |
310 Handle h_obj = basic_create(length, is_latin1, CHECK_NH); |
310 Handle h_obj = basic_create(length, is_latin1, CHECK_NH); |
311 if (length > 0) { |
311 if (length > 0) { |
312 if (!has_multibyte) { |
312 if (!has_multibyte) { |
313 strncpy((char*)value(h_obj())->byte_at_addr(0), utf8_str, length); |
313 const jbyte* src = reinterpret_cast<const jbyte*>(utf8_str); |
|
314 ArrayAccess<>::arraycopy_from_native(src, value(h_obj()), typeArrayOopDesc::element_offset<jbyte>(0), length); |
314 } else if (is_latin1) { |
315 } else if (is_latin1) { |
315 UTF8::convert_to_unicode(utf8_str, value(h_obj())->byte_at_addr(0), length); |
316 UTF8::convert_to_unicode(utf8_str, value(h_obj())->byte_at_addr(0), length); |
316 } else { |
317 } else { |
317 UTF8::convert_to_unicode(utf8_str, value(h_obj())->char_at_addr(0), length); |
318 UTF8::convert_to_unicode(utf8_str, value(h_obj())->char_at_addr(0), length); |
318 } |
319 } |
354 } |
355 } |
355 |
356 |
356 Handle h_obj = basic_create(length, is_latin1, CHECK_NH); |
357 Handle h_obj = basic_create(length, is_latin1, CHECK_NH); |
357 if (length > 0) { |
358 if (length > 0) { |
358 if (!has_multibyte) { |
359 if (!has_multibyte) { |
359 strncpy((char*)value(h_obj())->byte_at_addr(0), utf8_str, length); |
360 const jbyte* src = reinterpret_cast<const jbyte*>(utf8_str); |
|
361 ArrayAccess<>::arraycopy_from_native(src, value(h_obj()), typeArrayOopDesc::element_offset<jbyte>(0), length); |
360 } else if (is_latin1) { |
362 } else if (is_latin1) { |
361 UTF8::convert_to_unicode(utf8_str, value(h_obj())->byte_at_addr(0), length); |
363 UTF8::convert_to_unicode(utf8_str, value(h_obj())->byte_at_addr(0), length); |
362 } else { |
364 } else { |
363 UTF8::convert_to_unicode(utf8_str, value(h_obj())->char_at_addr(0), length); |
365 UTF8::convert_to_unicode(utf8_str, value(h_obj())->char_at_addr(0), length); |
364 } |
366 } |