IXmlJsonReaderInitializer.SetInput メソッド

定義

JAVAScript Object Notation (JSON) 対応リーダーを、JSON でエンコードされたデータを含む指定されたストリームまたはバッファーに再初期化します。

オーバーロード

名前 説明
SetInput(Stream, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose)

JAVAScript Object Notation (JSON) 対応リーダーを、JSON でエンコードされたデータを含む指定されたストリームに再初期化します。

SetInput(Byte[], Int32, Int32, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose)

JAVAScript Object Notation (JSON) 対応リーダーを、JSON でエンコードされたデータを含む指定されたバッファーに再初期化します。

注釈

CreateJsonReaderメソッドの 1 つによって作成されたXmlDictionaryReader オブジェクトは、このインターフェイスを実装し、JSON でエンコードされたデータを読み取る準備ができています。 ただし、ユーザーが他の JSON でエンコードされたデータを読み取るために同じ XmlDictionaryReader オブジェクトを再利用する場合は、 SetInput メソッドのいずれかを使用して読み取る 2 番目のデータセットにリーダーを初期化する必要があります。

quotas パラメーターの一部として設定されたMaxBytesPerRead値は、SetInput(Stream, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose) メソッドを使用してストリームから入力を読み取るときにメモリに読み込まれる情報の量のみを制限し、SetInput(Byte[], Int32, Int32, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose) メソッドを使用してバッファーから情報を読み取る場合は適用されません。 読み込むことができる属性の数に関する制限は、JSON コンテキストには関係ありません。

SetInput(Stream, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose)

JAVAScript Object Notation (JSON) 対応リーダーを、JSON でエンコードされたデータを含む指定されたストリームに再初期化します。

public:
 void SetInput(System::IO::Stream ^ stream, System::Text::Encoding ^ encoding, System::Xml::XmlDictionaryReaderQuotas ^ quotas, System::Xml::OnXmlDictionaryReaderClose ^ onClose);
public void SetInput(System.IO.Stream stream, System.Text.Encoding encoding, System.Xml.XmlDictionaryReaderQuotas quotas, System.Xml.OnXmlDictionaryReaderClose onClose);
abstract member SetInput : System.IO.Stream * System.Text.Encoding * System.Xml.XmlDictionaryReaderQuotas * System.Xml.OnXmlDictionaryReaderClose -> unit
Public Sub SetInput (stream As Stream, encoding As Encoding, quotas As XmlDictionaryReaderQuotas, onClose As OnXmlDictionaryReaderClose)

パラメーター

stream
Stream

読み取り元の入力 Stream

encoding
Encoding

リーダーによって使用される Encoding

quotas
XmlDictionaryReaderQuotas

XmlDictionaryReaderQuotas を選択して適用します。

onClose
OnXmlDictionaryReaderClose

リーダーが閉じられたときに呼び出すデリゲート。

注釈

JSON でエンコードされたストリームを読み取る XmlDictionaryReader オブジェクトは、 SetInput(Stream, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose) メソッドを呼び出して再初期化することで再利用できます。

リーダーは、UTF-8 と UTF-16 (ビッグ エンディアンまたはリトル エンディアン) エンコードを解釈できます。 リーダーは、初期化時にエンコード セットが渡された場合に使用します。または、 null が渡されるとエンコードが自動的に検出されます。

quotas パラメーターの一部として設定されたMaxBytesPerRead値は、SetInput(Stream, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose) メソッドを使用してストリームから入力を読み取るときにメモリに読み込まれる情報の量のみを制限し、SetInput(Byte[], Int32, Int32, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose) メソッドを使用してバッファーから情報を読み取る場合は適用されません。 読み込むことができる属性の数に関する制限は、JSON コンテキストには関係ありません。

適用対象

SetInput(Byte[], Int32, Int32, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose)

JAVAScript Object Notation (JSON) 対応リーダーを、JSON でエンコードされたデータを含む指定されたバッファーに再初期化します。

public:
 void SetInput(cli::array <System::Byte> ^ buffer, int offset, int count, System::Text::Encoding ^ encoding, System::Xml::XmlDictionaryReaderQuotas ^ quotas, System::Xml::OnXmlDictionaryReaderClose ^ onClose);
public void SetInput(byte[] buffer, int offset, int count, System.Text.Encoding encoding, System.Xml.XmlDictionaryReaderQuotas quotas, System.Xml.OnXmlDictionaryReaderClose onClose);
abstract member SetInput : byte[] * int * int * System.Text.Encoding * System.Xml.XmlDictionaryReaderQuotas * System.Xml.OnXmlDictionaryReaderClose -> unit
Public Sub SetInput (buffer As Byte(), offset As Integer, count As Integer, encoding As Encoding, quotas As XmlDictionaryReaderQuotas, onClose As OnXmlDictionaryReaderClose)

パラメーター

buffer
Byte[]

読み取り元のバッファー配列 Byte 入力。

offset
Int32

bufferで読み取る開始位置。

count
Int32

bufferから読み取ることができるバイト数。

encoding
Encoding

リーダーによって使用される Encoding

onClose
OnXmlDictionaryReaderClose

リーダーが閉じられたときに呼び出す OnXmlDictionaryReaderClose デリゲート。

注釈

JSON でエンコードされたバッファーByteを読み取るXmlDictionaryReader オブジェクトは、SetInput(Byte[], Int32, Int32, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose) メソッドを呼び出して再初期化することで再利用できます。

リーダーは、UTF-8 と UTF-16 (ビッグ エンディアンまたはリトル エンディアン) エンコードを解釈できます。 リーダーは、初期化時にエンコード セットが渡された場合に使用します。または、 null が渡されるとエンコードが自動的に検出されます。

quotas パラメーターの一部として設定されたMaxBytesPerRead値は、SetInput(Stream, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose) メソッドを使用してストリームから入力を読み取るときにメモリに読み込まれる情報の量のみを制限し、SetInput(Byte[], Int32, Int32, Encoding, XmlDictionaryReaderQuotas, OnXmlDictionaryReaderClose) メソッドを使用してバッファーから情報を読み取る場合は適用されません。 読み込むことができる属性の数に関する制限は、JSON コンテキストには関係ありません。

適用対象