WriteInt16() public method

public WriteInt16 ( short value ) : void
value short
return void
Example #1
0
 private void WriteNameOrOrdinal(ResourceEntry entry, Dictionary <string, int> strings, ref int stringTableOffset, ByteBuffer stringTable)
 {
     if (entry.Name == null)
     {
         win32_resources.WriteUInt32(entry.Id);
     }
     else
     {
         int stringOffset;
         if (!strings.TryGetValue(entry.Name, out stringOffset))
         {
             stringOffset = stringTableOffset;
             strings.Add(entry.Name, stringOffset);
             stringTableOffset += entry.Name.Length * 2 + 2;
             stringTable.WriteUInt16((ushort)entry.Name.Length);
             foreach (char c in entry.Name)
             {
                 stringTable.WriteInt16((short)c);
             }
         }
         win32_resources.WriteUInt32(0x80000000U | (uint)stringOffset);
     }
 }
Example #2
0
 private void WriteNameOrOrdinal(ResourceEntry entry, Dictionary<string, int> strings, ref int stringTableOffset, ByteBuffer stringTable)
 {
     if (entry.Name == null)
     {
         win32_resources.WriteUInt32(entry.Id);
     }
     else
     {
         int stringOffset;
         if (!strings.TryGetValue(entry.Name, out stringOffset))
         {
             stringOffset = stringTableOffset;
             strings.Add(entry.Name, stringOffset);
             stringTableOffset += entry.Name.Length * 2 + 2;
             stringTable.WriteUInt16((ushort)entry.Name.Length);
             foreach (char c in entry.Name)
                 stringTable.WriteInt16((short)c);
         }
         win32_resources.WriteUInt32(0x80000000U | (uint)stringOffset);
     }
 }