MCPcopy Create free account
hub / github.com/davidgiven/luje / expand

Method expand

lib/java/io/ByteArrayOutputStream.java:87–96  ·  view source on GitHub ↗
(int i)

Source from the content-addressed store, hash-verified

85 }
86
87 private void expand(int i) {
88 /* Can the buffer handle @i more bytes, if not expand it */
89 if (count + i <= buf.length) {
90 return;
91 }
92
93 byte[] newbuf = new byte[(count + i) * 2];
94 System.arraycopy(buf, 0, newbuf, 0, count);
95 buf = newbuf;
96 }
97
98 /**
99 * Resets this stream to the beginning of the underlying byte array. All

Callers 1

writeMethod · 0.95

Calls 1

arraycopyMethod · 0.95

Tested by

no test coverage detected