CborWriter 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| CborWriter(CborConformanceMode, Boolean, Boolean) |
使用指定的設定,將 CborWriter 類別的新執行個體初始化。 |
| CborWriter(CborConformanceMode, Boolean, Boolean, Int32) |
CborWriter(CborConformanceMode, Boolean, Boolean)
使用指定的設定,將 CborWriter 類別的新執行個體初始化。
public:
CborWriter(System::Formats::Cbor::CborConformanceMode conformanceMode, bool convertIndefiniteLengthEncodings, bool allowMultipleRootLevelValues);
public CborWriter (System.Formats.Cbor.CborConformanceMode conformanceMode = System.Formats.Cbor.CborConformanceMode.Strict, bool convertIndefiniteLengthEncodings = false, bool allowMultipleRootLevelValues = false);
public CborWriter (System.Formats.Cbor.CborConformanceMode conformanceMode, bool convertIndefiniteLengthEncodings, bool allowMultipleRootLevelValues);
new System.Formats.Cbor.CborWriter : System.Formats.Cbor.CborConformanceMode * bool * bool -> System.Formats.Cbor.CborWriter
Public Sub New (Optional conformanceMode As CborConformanceMode = System.Formats.Cbor.CborConformanceMode.Strict, Optional convertIndefiniteLengthEncodings As Boolean = false, Optional allowMultipleRootLevelValues As Boolean = false)
Public Sub New (conformanceMode As CborConformanceMode, convertIndefiniteLengthEncodings As Boolean, allowMultipleRootLevelValues As Boolean)
參數
- conformanceMode
- CborConformanceMode
其中一個列舉值,用來指定針對編碼資料執行一致性模式檢查的指導。 預設為 Strict 一致性模式。
- convertIndefiniteLengthEncodings
- Boolean
true 啟用自動將無限長度編碼轉換成明確長度對等專案,並允許在不允許的一致性模式中使用無限長度寫入 API;否則為 false。
- allowMultipleRootLevelValues
- Boolean
true 允許寫入器寫入多個根層級的值;否則為 false。
例外狀況
conformanceMode 不是已定義的 CborConformanceMode。
適用於
CborWriter(CborConformanceMode, Boolean, Boolean, Int32)
public CborWriter (System.Formats.Cbor.CborConformanceMode conformanceMode = System.Formats.Cbor.CborConformanceMode.Strict, bool convertIndefiniteLengthEncodings = false, bool allowMultipleRootLevelValues = false, int initialCapacity = -1);
new System.Formats.Cbor.CborWriter : System.Formats.Cbor.CborConformanceMode * bool * bool * int -> System.Formats.Cbor.CborWriter
Public Sub New (Optional conformanceMode As CborConformanceMode = System.Formats.Cbor.CborConformanceMode.Strict, Optional convertIndefiniteLengthEncodings As Boolean = false, Optional allowMultipleRootLevelValues As Boolean = false, Optional initialCapacity As Integer = -1)
參數
- conformanceMode
- CborConformanceMode
- convertIndefiniteLengthEncodings
- Boolean
- allowMultipleRootLevelValues
- Boolean
- initialCapacity
- Int32