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)
| 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 | /** |
no test coverage detected