Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
Compound File .NET
>
Tutorial
> Read stream
The following example shows you how to get stream from file and save it to local file system.
C# example
using System; using Independentsoft.IO.StructuredStorage; namespace Sample { class Program { static void Main(string[] args) { CompoundFile file = new CompoundFile("c:\\temp\\file1.bin"); Independentsoft.IO.StructuredStorage.Stream dataStream = (Independentsoft.IO.StructuredStorage.Stream)file.Root.DirectoryEntries["data"]; dataStream.Save("c:\\temp\\data.bin"); } } }
VB example
Imports System Imports Independentsoft.IO.StructuredStorage Namespace Sample Class Module1 Shared Sub Main(ByVal args As String()) Dim file As New CompoundFile("c:\temp\file1.bin") Dim dataStream As Independentsoft.IO.StructuredStorage.Stream = DirectCast(file.Root.DirectoryEntries("data"), Independentsoft.IO.StructuredStorage.Stream) dataStream.Save("c:\temp\data.bin") End Sub End Class End Namespace