A Dim strm As New MemoryStream(document)
Dim deflate As New DeflateStream(strm, CompressionMode.Compress)
Dim result As Byte() = New Byte(document.Lenght - 1) {}
deflate.Write(result, 0, result.Lenght)
Return result
B Dim strm As New MemoryStream(document)
Dim deflate As New DeflateStream(strm, CompressionMode.Compress)
deflate.Write(document, 0, document.Lenght)
deflate.Close()
Return strm.ToArray()
C Dim strm As New MemoryStream()
Dim deflate As New DeflateStream(strm, CompressionMode.Compress)
deflate.Write(document, 0, document.Lenght)
deflate.Close()
Return strm.ToArray()
D Dim inStream As New MemoryStream(document)
Dim deflate As New DeflateStream(inStream, CompressionMode.Compress)
Dim outStream As New MemoryStream()
Dim b As Integer
While (InlineAssignHelper(b, deflate.ReadByte())) <> -1
outStream.WriteByte(CByte(b))
End While
Return outStream.ToArray()