📌  相关文章
📜  将视频转换为字节数组c#代码示例

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

代码示例1
HttpWebRequest request; 
request.Method = "PUT";

using(Stream requestStream = request.GetRequestStream())
using(Stream video = File.OpenRead("Path")) {
    byte[] buffer = new byte[4096];

    while(true) {
        int bytesRead = video.Read(buffer, 0, buffer.Length);

        if (bytesRead == 0) break;
        requestStream.Write(buffer, 0, bytesRead);
    }
}