📜  c 锐流到字节数组 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:16.806000             🧑  作者: Mango

代码示例1
public static byte[] ReadFully(Stream input)
{
    byte[] buffer = new byte[16*1024];
    using (MemoryStream ms = new MemoryStream())
    {
        int read;
        while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
        {
            ms.Write(buffer, 0, read);
        }
        return ms.ToArray();
    }
}