IBinarySerialize.Write メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > IBinarySerialize.Write メソッドの意味・解説 

IBinarySerialize.Write メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

ユーザー定義型 (UDT) またはユーザー定義集計を永続化できるように、バイナリ形式変換します

名前空間: Microsoft.SqlServer.Server
アセンブリ: System.Data (system.data.dll 内)
構文構文

Sub Write ( _
    w As BinaryWriter _
)
Dim instance As IBinarySerialize
Dim w As BinaryWriter

instance.Write(w)
void Write (
    BinaryWriter w
)
void Write (
    BinaryWriter^ w
)
void Write (
    BinaryWriter w
)
function Write (
    w : BinaryWriter
)

パラメータ

w

シリアル化した UDT またはユーザー定義集計を格納する BinaryWriter ストリーム

解説解説
使用例使用例

BinaryWriter使用してユーザー定義バイナリ形式UDTシリアル化する、Write メソッド実装の例次に示しますnull 文字埋め込む目的は、文字列値を double 型の値と分離することにあります。これにより、1 つUDTTransact-SQL コード内の別の UDT文字列バイト文字列バイト、および double 型のバイトdouble 型のバイトそれぞれ比較できます

' The binary layout is as follows:
'    Bytes 0 - 19: string text, padded to the right with null characters
'    Bytes 20+: Double value
Public Sub Write(ByVal w
 As System.IO.BinaryWriter) _
  Implements Microsoft.SqlServer.Server.IBinarySerialize.Write

    Dim maxStringSize As Integer
 = 20
    Dim stringValue As String
 = "The value of PI: "
    Dim paddedString As String
    Dim value As Double
 = 3.14159

    ' Pad the string from the right with null characters.
    paddedString = stringValue.PadRight(maxStringSize, ControlChars.NullChar)
    
    
    ' Write the string value one byte at a time.
    Dim i As Integer
    For i = 0 To paddedString.Length - 1 Step
 1 
        w.Write(paddedString(i))
    Next

    ' Write the double value.
    w.Write(value)
    
End Sub
// The binary layout is as follows:
//    Bytes 0 - 19: string text, padded to the right with null characters
//    Bytes 20+: Double value
public void Write(System.IO.BinaryWriter w)
{        
    int maxStringSize = 20;
    string stringValue = "The value of PI: ";
    string paddedString; 
    double value = 3.14159;

    // Pad the string from the right with null characters.
    paddedString = stringValue.PadRight(maxStringSize, '\0');

    // Write the string value one byte at a time.
    for (int i = 0; i < paddedString.Length;
 i++)
    {
        w.Write(paddedString[i]);
    }

    // Write the double value.
    w.Write(value);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
IBinarySerialize インターフェイス
IBinarySerialize メンバ
Microsoft.SqlServer.Server 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からIBinarySerialize.Write メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からIBinarySerialize.Write メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からIBinarySerialize.Write メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「IBinarySerialize.Write メソッド」の関連用語

IBinarySerialize.Write メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



IBinarySerialize.Write メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS