Exemplo n.º 1
0
 private static void WriteAssemblyName(SerializationState state, ElementWithTypeInfo element)
 {
     if (element != null)
     {
         var   assName = element.AssemblyName;
         Int32 id;
         if (state.TryAddAssemblyName(assName, out id))
         {
             var strByteCount = UTF8.GetByteCount(assName);
             state.EnsureCapacity(10 + strByteCount);
             state.array
             .WriteByteToBytes(ref state.idx, (Byte)RecordTypeEnumeration.BinaryLibrary)
             .WriteInt32LEToBytes(ref state.idx, id)
             .WriteInt32Encoded7Bit(ref state.idx, strByteCount)
             .WriteStringToBytes(ref state.idx, UTF8, assName);
             state.WriteArrayToStream();
         }
     }
 }