System::Security::Cryptography::CryptoStream 类

CryptoStream class

流实现,使用加密函数包装现有流。此类的对象只能通过 System::MakeObject() 函数分配。切勿在栈上或使用 operator new 创建此类型的实例,因为会导致运行时错误和/或断言故障。始终将此类包装到 System::SmartPtr 指针中,并使用该指针将其作为参数传递给函数。

class CryptoStream : public System::IO::Stream

方法

方法描述
Close() override关闭连接。
CryptoStream(const SharedPtr<System::IO::Stream>&, const SharedPtr<ICryptoTransform>&, CryptoStreamMode)构造函数。
Flush() override将缓冲区内容写入包装的流。若转换算法仍在等待更多数据,则不执行任何操作。
FlushFinalBlock()将缓冲区中仍未写入的数据写入流。
get_CanRead() const override检查流是否可读。
get_CanSeek() const override检查流是否可定位。
get_CanWrite() const override检查流是否可写。
get_Length() const override获取流的长度。不支持。
get_Position() const override获取流中的当前位置。不支持。
Read(const ArrayPtr<uint8_t>&, int32_t, int32_t) override从流中读取数据。
Read(const System::Details::ArrayView<uint8_t>&, int32_t, int32_t) override从流中读取数据。
Seek(int64_t, IO::SeekOrigin) override在流中定位位置。不支持。
set_Position(int64_t) override在流中定位位置。不支持。
SetLength(int64_t) override在流中定位大小。不支持。
Write(const ArrayPtr<uint8_t>&, int32_t, int32_t) override向流写入数据。
Write(const System::Details::ArrayView<uint8_t>&, int32_t, int32_t) override向流写入数据。

字段

字段描述
static Null没有底层存储的流。

另见