IPacket.ReadBytes メソッド

更新 : 2007 年 11 月

オブジェクトからバイトの配列を読み取り、内部反復子がパケット内の次のデータ オブジェクトを指すようにします。

名前空間 :  Microsoft.SmartDevice.DeviceAgentTransport
アセンブリ :  Microsoft.SmartDevice.DeviceAgentTransport (Microsoft.SmartDevice.DeviceAgentTransport.dll 内)

構文

'宣言
Sub ReadBytes ( _
    <OutAttribute> ByRef ppbuffer As IntPtr, _
    <OutAttribute> ByRef in_readSize As UInteger _
)
'使用
Dim instance As IPacket
Dim ppbuffer As IntPtr
Dim in_readSize As UInteger

instance.ReadBytes(ppbuffer, in_readSize)
void ReadBytes(
    out IntPtr ppbuffer,
    out uint in_readSize
)
void ReadBytes(
    [OutAttribute] IntPtr% ppbuffer, 
    [OutAttribute] unsigned int% in_readSize
)
function ReadBytes(
    ppbuffer : IntPtr, 
    in_readSize : uint
)

パラメータ

  • ppbuffer
    型 : System.IntPtr%

    [出力] バイトの配列は ppbuffer に読み込まれます。

  • in_readSize
    型 : System.UInt32%

    [出力] ppbuffer に読み込むバイト数を指定します。

解説

このメソッドを呼び出した後、System.IntPtrSystem.Byte 型の配列に変換するには、InteropUtils.ConvertIntPtrToByteArray を使用します。

' Read bytes and convert IntPtr to byte[]
Dim ptr As IntPtr
Dim size As System.UInt32 = 0
packet.ReadBytes(ptr, size)
Dim buffer As Byte() = InteropUtils.ConvertIntPtrToByteArray(ptr, _
    Convert.ToInt32(size))
// Read bytes and convert IntPtr to byte[]
IntPtr ptr;
uint size = 0;
packet.ReadBytes(out ptr, out size);
byte[] buffer = InteropUtils.ConvertIntPtrToByteArray(ptr, 
    Convert.ToInt32(size));

アクセス許可

  • 直前の呼び出し元に対する完全な信頼。このメンバは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

IPacket インターフェイス

IPacket メンバ

Microsoft.SmartDevice.DeviceAgentTransport 名前空間