Returns a new CharBuffer identical to buf, except twice the capacity.
(CharBuffer buf)
| 188 | |
| 189 | /** Returns a new CharBuffer identical to buf, except twice the capacity. */ |
| 190 | private static CharBuffer grow(CharBuffer buf) { |
| 191 | char[] copy = Arrays.copyOf(buf.array(), buf.capacity() * 2); |
| 192 | CharBuffer bigger = CharBuffer.wrap(copy); |
| 193 | bigger.position(buf.position()); |
| 194 | bigger.limit(buf.limit()); |
| 195 | return bigger; |
| 196 | } |
| 197 | |
| 198 | /** Handle the case of underflow caused by needing more input characters. */ |
| 199 | private void readMoreChars() throws IOException { |
no test coverage detected