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

Method duplicate

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

Copy the src into this MessageBytes, allocating more space if needed. @param src The source @throws IOException Writing overflow data to the output channel failed

(MessageBytes src)

Source from the content-addressed store, hash-verified

584 * @throws IOException Writing overflow data to the output channel failed
585 */
586 public void duplicate(MessageBytes src) throws IOException {
587 switch (src.getType()) {
588 case T_BYTES:
589 type = T_BYTES;
590 ByteChunk bc = src.getByteChunk();
591 byteC.allocate(2 * bc.getLength(), -1);
592 byteC.append(bc);
593 break;
594 case T_CHARS:
595 type = T_CHARS;
596 CharChunk cc = src.getCharChunk();
597 charC.allocate(2 * cc.getLength(), -1);
598 charC.append(cc);
599 break;
600 case T_STR:
601 type = T_STR;
602 String sc = src.getString();
603 this.setString(sc);
604 break;
605 case T_NULL:
606 recycle();
607 }
608 setCharset(src.getCharset());
609 }
610
611 // efficient long
612 /**

Callers 1

postParseRequestMethod · 0.95

Calls 11

setStringMethod · 0.95
recycleMethod · 0.95
setCharsetMethod · 0.95
getByteChunkMethod · 0.80
getCharChunkMethod · 0.80
getTypeMethod · 0.65
allocateMethod · 0.65
getLengthMethod · 0.65
getStringMethod · 0.65
getCharsetMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected