()
| 649 | } |
| 650 | |
| 651 | public byte[] toBytes() { |
| 652 | Block block = tail.next; |
| 653 | if (block == tail) |
| 654 | return Arrays.copyOf(buf, pos); |
| 655 | tail.len = pos; |
| 656 | int p = 0; |
| 657 | for (; ; block = block.next) { |
| 658 | p += block.len; |
| 659 | if (block == tail) |
| 660 | break; |
| 661 | } |
| 662 | byte[] res = new byte[p]; |
| 663 | p = 0; |
| 664 | for (block = tail.next; ; block = block.next) { |
| 665 | System.arraycopy(block.buf, 0, res, p, block.len); |
| 666 | p += block.len; |
| 667 | if (block == tail) |
| 668 | return res; |
| 669 | } |
| 670 | } |
| 671 | |
| 672 | public char[] toChars() { |
| 673 | char[] res = new char[charSize()]; |
no outgoing calls
no test coverage detected