Convert to char[] and fill the CharChunk. Note: The conversion from bytes is not optimised - it converts to String first. However, Tomcat doesn't call this method to convert from bytes so there is no benefit from optimising that path.
()
| 332 | * method to convert from bytes so there is no benefit from optimising that path. |
| 333 | */ |
| 334 | public void toChars() { |
| 335 | switch (type) { |
| 336 | case T_NULL: |
| 337 | charC.recycle(); |
| 338 | //$FALL-THROUGH$ |
| 339 | case T_CHARS: |
| 340 | // No conversion required |
| 341 | return; |
| 342 | case T_BYTES: |
| 343 | toString(); |
| 344 | //$FALL-THROUGH$ |
| 345 | case T_STR: { |
| 346 | char[] cc = strValue.toCharArray(); |
| 347 | charC.setChars(cc, 0, cc.length); |
| 348 | } |
| 349 | } |
| 350 | } |
| 351 | |
| 352 | |
| 353 | /** |