If possible, reads chars from the provided CharBuffer directly into underlying character buffer without making extra copies. @return The number of characters read. @see #appendTo(Appendable)
(CharBuffer charBuffer)
| 1718 | * @return The number of characters read. |
| 1719 | * @see #appendTo(Appendable) */ |
| 1720 | public int readFrom (CharBuffer charBuffer) { |
| 1721 | int oldSize = size; |
| 1722 | int remaining = charBuffer.remaining(); |
| 1723 | require(remaining); |
| 1724 | charBuffer.get(items, size, remaining); |
| 1725 | size += remaining; |
| 1726 | return size - oldSize; |
| 1727 | } |
| 1728 | |
| 1729 | /** If possible, reads all chars from the provided {@link Readable} directly into underlying character buffer without making |
| 1730 | * extra copies. |