如何将list(of byte())组合成一个字节数组

时间:2013-06-25 20:18:51

标签: vb.net bytearray tiff

我的可变文档是一个列表(byte())。我有一个有两页的tiff图像,但我只能保存第一页。如何将所有页面作为一个文件返回?

Dim tiffByte = convertToTiff(documents)
                        Response.Clear()
                        Response.ContentType = "image/tiff"
                        Response.AppendHeader("Content-Disposition", "attachment; filename=theFile.tiff")
                        Response.OutputStream.Write(tiffByte, 0, tiffByte.Length)
                        Response.Flush()
                        Response.Close()

Private Function convertToTiff(ByRef images As List(Of Byte())) As Byte()
    Dim tiffByte As Byte()

    tiffByte = images.SelectMany(Function(bytes) bytes).ToArray()
    Return tiffByte
End Function

0 个答案:

没有答案