Save file from a byte[] in C# NET 3.5

后端 未结 5 1704
长发绾君心
长发绾君心 2021-02-04 04:39

My TCP Client receives a image within a packet.The image is compressed with zlib.The task is to decompress the image and put it on the form.

I\'m planning to save the co

5条回答
  •  温柔的废话
    2021-02-04 05:22

    public static void SaveFile(this Byte[] fileBytes, string fileName)
    {
        FileStream fileStream = new FileStream(fileName, FileMode.Create, FileAccess.ReadWrite);
        fileStream.Write(fileBytes, 0, fileBytes.Length);
        fileStream.Close();
    }
    

提交回复
热议问题