MCPcopy Index your code
hub / github.com/antlr/codebuff / grow

Method grow

output/java_guava/1.4.17/ReaderInputStream.java:184–190  ·  view source on GitHub ↗

Returns a new CharBuffer identical to buf, except twice the capacity.

(CharBuffer buf)

Source from the content-addressed store, hash-verified

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

Callers 1

readMoreCharsMethod · 0.95

Calls 4

copyOfMethod · 0.45
capacityMethod · 0.45
wrapMethod · 0.45
limitMethod · 0.45

Tested by

no test coverage detected