We probably need to change to growable buffers here pretty soon. Otherwise we have a performance problem where we pay for 64 KiB even if we aren't using it.