Returns a new CharBuffer identical to buf, except twice the capacity.
(CharBuffer buf)
| 182 | /** Returns a new CharBuffer identical to buf, except twice the capacity. */ |
| 183 | |
| 184 | private static CharBuffer grow(CharBuffer buf) { |
| 185 | char[] copy = Arrays.copyOf(buf.array(), buf.capacity() * 2); |
| 186 | CharBuffer bigger = CharBuffer.wrap(copy); |
| 187 | bigger.position(buf.position()); |
| 188 | bigger.limit(buf.limit()); |
| 189 | return bigger; |
| 190 | } |
| 191 | |
| 192 | /** Handle the case of underflow caused by needing more input characters. */ |
| 193 |
no test coverage detected