Independentsoft
Any library, any programming language
Home
Purchase
Support
Company
Contact
JCompound
>
Tutorial
> Read stream
The following example shows you how to get stream from file and save it to local file system.
import java.io.IOException; import com.independentsoft.io.structuredstorage.CompoundFile; import com.independentsoft.io.structuredstorage.Stream; public class Example { public static void main(String[] args) { try { CompoundFile file = new CompoundFile("c:\\temp\\test.msg"); Stream dataStream = (Stream) file.getRoot().getDirectoryEntries().get("data"); dataStream.save("c:\\temp\\data.bin"); } catch (IOException e) { e.printStackTrace(); } } }