The IStream interface of the com.ms.com package provides methods for reading and writing data to stream objects. Each stream has its own access rights and seek pointer.
public interface IStream extends IUnknown { // Fields public static final _Guid iid; public static final int LOCK_EXCLUSIVE; public static final int LOCK_ONLYONCE; public static final int LOCK_WRITE; public static final int STATFLAG_DEFAULT; public static final int STATFLAG_NONAME; public static final int STATFLAG_NOOPEN; public static final int STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE; public static final int STGC_DEFAULT; public static final int STGC_ONLYIFCURRENT; public static final int STGC_OVERWRITE; public static final int STREAM_SEEK_CUR; public static final int STREAM_SEEK_END; public static final int STREAM_SEEK_SET; // Methods public IStream Clone(); public void Commit(int grfCommitFlags); public void CopyTo(IStream pstm, long cb, long[] pcbRead, long[] pcbWritten); public void LockRegion(long libOffset, long cb, int dwLockType); public int Read(byte buf[], int off, int len); public void Revert(); public long Seek(long dlibMove, int dwOrigin); public void SetSize(long libNewSize); public void Stat(STATSTG pstatstg, int grfStatFlag); public void UnlockRegion(long libOffset, long cb, int dwLockType); public int Write(byte buf[], int off, int len); }
The main difference between a stream object and an MS-DOS file is that streams are opened through an IStream interface pointer instead of using a file handle. Simple data can be written directly to a stream. Usually, however, streams are elements nested within a storage object.
This interface wraps the Component Object Model (COM) IStream interface.
IUnknown | +--IStream