MCPcopy Index your code
hub / github.com/apache/tomcat / toChars

Method toChars

java/org/apache/tomcat/util/buf/MessageBytes.java:334–350  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

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 /**

Callers 11

testToCharsFromNullMethod · 0.95
testPerformanceImplMethod · 0.95
testMapMethod · 0.95
invokeMethod · 0.95
postParseRequestMethod · 0.95
MessageBytesTypeEnum · 0.80
testUtf8SurrogateBodyMethod · 0.80
mapMethod · 0.80
substituteVariablesMethod · 0.80

Calls 4

toStringMethod · 0.95
toCharArrayMethod · 0.80
recycleMethod · 0.65
setCharsMethod · 0.45

Tested by 6

testToCharsFromNullMethod · 0.76
testPerformanceImplMethod · 0.76
testMapMethod · 0.76
testUtf8SurrogateBodyMethod · 0.64