Question:You are writing a method to compress an array of bytes. The bytes to be compressed are passed to the method in a parameter named document. You need to compress the contents of the incoming parameter. Which code segment should you use? 

A Dim inStream As New MemoryStream(document)
Dim zipStream As New GZipStream( _
inStream, CompressionMode.Compress)
Dim result(document.Length) As Byte
zipStream.Write(result, 0, result.Length)
Return result 

B Dim outStream As New MemoryStream
Dim zipStream As New GZipStream( _
outStream, CompressionMode.Compress)
zipStream.Write(document, 0, document.Length)
zipStream.Close()
Return outStream.ToArray 

C Dim objStream As New MemoryStream(document)
Dim zipStream As New GZipStream( _
objStream, CompressionMode.Compress)
zipStream.Write(document, 0, document.Length)
zipStream.Close()
Return objStream.ToArray 

D Dim objStream As New MemoryStream(document)
Dim zipStream As New GZipStream( _
objStream, CompressionMode.Compress)
Dim outStream As New MemoryStream
Dim b As Integer
While (b = zipStream.ReadByte)
outStream.WriteByte(CByte(b))
End While
"A Composite Solution With Just One Click" - Certification Guaranteed 168 Microsoft 70-536 Exam Return outStream.ToArray 

+ Answer
+ Report
Total Preview: 788

Copyright © 2024. Powered by Intellect Software Ltd