IStream 接口
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供具有 ISequentialStream 功能的 IStream 接口的托管定义。
public interface class IStream[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
public interface IStream[System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)]
[System.Runtime.InteropServices.Guid("0000000c-0000-0000-C000-000000000046")]
public interface IStreampublic interface IStream[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)>]
type IStream = interface[<System.Runtime.InteropServices.InterfaceType(System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown)>]
[<System.Runtime.InteropServices.Guid("0000000c-0000-0000-C000-000000000046")>]
type IStream = interfacetype IStream = interfacePublic Interface IStream- 属性
注解
有关详细信息,请参阅 IStream 和 ISequentialStream 接口的文档。
当本机代码中的 COM 方法返回 HRESULT 以外的 S_OK时,公共语言运行时会引发异常。 有关更多信息,请参见 How to: Map HRESULTs and Exceptions。
方法
| Clone(IStream) | 创建具有自己的搜索指针的一个新的流对象,该指针引用与原始流相同的字节。 | 
| Commit(Int32) | 确保对在事务模式中打开的流对象的任何更改都在父存储中反映出来。 | 
| CopyTo(IStream, Int64, IntPtr, IntPtr) | 将指定的字节数从流中的当前搜索指针复制到其他流中的当前搜索指针。 | 
| LockRegion(Int64, Int64, Int32) | 限制对流中特定范围的字节的访问。 | 
| Read(Byte[], Int32, IntPtr) | 将指定数目的字节从流对象读入到以当前搜索指针开始的内存。 | 
| Revert() | 放弃自上一个 Commit(Int32) 调用后对事务流进行的所有更改。 | 
| Seek(Int64, Int32, IntPtr) | 将搜索指针更改为相对于流开始、流结束或当前搜索指针的新位置。 | 
| SetSize(Int64) | 更改流对象的大小。 | 
| Stat(STATSTG, Int32) | 检索此流的 STATSTG 结构。 | 
| UnlockRegion(Int64, Int64, Int32) | 取消对以前使用 LockRegion(Int64, Int64, Int32) 方法限制的对某一范围字节的访问限制。 | 
| Write(Byte[], Int32, IntPtr) | 将指定数目的字节写入以当前搜索指针开始的流对象。 |