docs: static final byte[] resizeBuffer(final byte[] buf, final int newsize) {
  		if (buf.length == newsize)
  			return buf;
  		final byte[] newbuf = new byte[newsize];
  		System.arraycopy(buf, 0, newbuf, 0, Math.min(buf.length, newbuf.length));
  		return newbuf;
  	}