Expands the internal buffer to accommodate the specified number of bytes. @param newcount the new minimum capacity required
(int newcount)
| 320 | * @param newcount the new minimum capacity required |
| 321 | */ |
| 322 | public void expand(int newcount) { |
| 323 | // don't change the allocation strategy |
| 324 | byte[] newbuf = new byte[Math.max(buf.length << 1, newcount)]; |
| 325 | System.arraycopy(buf, 0, newbuf, 0, bufSize); |
| 326 | buf = newbuf; |
| 327 | } |
| 328 | |
| 329 | /** |
| 330 | * Returns the current capacity of the internal buffer. |