Xceed Streaming Compression Library Documentation
Examples / Compressing from file to memory (VB example)
In This Topic
    Compressing from file to memory (VB example)
    In This Topic
    Visual Basic Copy Code

    Dim xComp As New XceedStreamingCompression

    Call xComp.License( "your license key" ) 

    Dim vaBytesRead As Variant 

    Set xComp.CompressionFormat = New XceedBZip2CompressionFormat 

    On Error Resume Next

    Call xComp.ReadFile("c:\temp\source.txt", 0, 0, cfpCompress, True, vaBytesRead) 

    If Err.Number = 0 Then
      Call MsgBox("Compression successful!") 
    Else
      Call MsgBox(Err.Description) 
    End If 

    Set xComp = Nothing