Exemplo n.º 1
0
 public void Dispose()
 {
     _tributary.Position = 0;
     if (_tributary.Length <= ushort.MaxValue)
     {
         using (HeaderExport.Subrecord(_writer, _mainRecord))
         {
             _tributary.CopyTo(_writer.BaseStream);
         }
     }
     else
     {
         using (HeaderExport.Subrecord(_writer, _overflowRecord))
         {
             _writer.Write(checked ((uint)_tributary.Length));
         }
         _writer.Write(_mainRecord.TypeInt);
         _writer.WriteZeros(2);
         _tributary.CopyTo(_writer.BaseStream);
     }
 }
 public static void Write(
     this ByteArrayBinaryTranslation <MutagenFrame, MutagenWriter> transl,
     MutagenWriter writer,
     ReadOnlyMemorySlice <byte>?item,
     RecordType header)
 {
     try
     {
         if (!item.HasValue)
         {
             return;
         }
         using (HeaderExport.Subrecord(writer, header))
         {
             transl.Write(writer, item.Value.Span);
         }
     }
     catch (Exception ex)
     {
         throw SubrecordException.Enrich(ex, header);
     }
 }
Exemplo n.º 3
0
 public static void Write(
     this PrimitiveBinaryTranslation <float, MutagenFrame, MutagenWriter> transl,
     MutagenWriter writer,
     float?item,
     RecordType header,
     FloatIntegerType integerType,
     double multiplier)
 {
     try
     {
         if (item == null)
         {
             return;
         }
         using (HeaderExport.Subrecord(writer, header))
         {
             FloatBinaryTranslation <MutagenFrame, MutagenWriter> .Instance.Write(writer, item, integerType, multiplier);
         }
     }
     catch (Exception ex)
     {
         throw SubrecordException.Factory(ex, header);
     }
 }