ResourceLib/StringTableEntry.cs
/// <summary>
/// Write a string resource to a binary stream.
/// </summary>
/// <param name="w">Binary stream.</param>
Write a string resource to a binary stream.
Write a string resource to a binary stream .
internal void Write(BinaryWriter w)
        {
            long headerPos = w.BaseStream.Position;
            w.Write((UInt16) _header.wLength);
            w.Write((UInt16) _header.wValueLength);
            w.Write((UInt16) _header.wType);
            w.Write(Encoding.Unicode.GetBytes(_key));
            w.Write((UInt16) 0);
            ResourceUtil.PadToDWORD(w);
            long valuePos = w.BaseStream.Position;
            if (_value != null)
            {
                w.Write(Encoding.Unicode.GetBytes(_value));
            }
            ResourceUtil.WriteAt(w, (w.BaseStream.Position - valuePos) / Marshal.SystemDefaultCharSize, headerPos + 2);
            ResourceUtil.WriteAt(w, w.BaseStream.Position - headerPos, headerPos);
        }
internal void Write ( BinaryWriter w ) { long headerPos = w . BaseStream . Position ; w . Write ( ( UInt16 ) _header . wLength ) ; w . Write ( ( UInt16 ) _header . wValueLength ) ; w . Write ( ( UInt16 ) _header . wType ) ; w . Write ( Encoding . Unicode . GetBytes ( _key ) ) ; w . Write ( ( UInt16 ) 0 ) ; ResourceUtil . PadToDWORD ( w ) ; long valuePos = w . BaseStream . Position ; if ( _value != null ) { w . Write ( Encoding . Unicode . GetBytes ( _value ) ) ; } ResourceUtil . WriteAt ( w , ( w . BaseStream . Position - valuePos ) / Marshal . SystemDefaultCharSize , headerPos + 2 ) ; ResourceUtil . WriteAt ( w , w . BaseStream . Position - headerPos , headerPos ) ; }
Write a string resource to a binary stream.
Write a string resource to a binary stream .
// write the block info // wLength // wValueLength // wType // szKey // null terminator // pad fixed info // value (always double-null-terminated) // wValueLength // wLength
w
BinaryWriter
None