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

Method grow

corpus/java/training/guava/io/ReaderInputStream.java:190–196  ·  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

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 {

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