internal static void SizeAtLeast(ref byte[] buffer, int minLength) { if (buffer.Length < minLength) Array.Resize(ref buffer, ((minLength + 1023) / 1024) * 1024); }