Ejemplo n.º 1
0
        public void WriteThing(SomeMemoryStreamWrapperThing dest, object subject)
        {
            dest.Write(fullTypeBinaryRepresentationCache.GetOrCompute(simplifiedKvpType));

            using (dest.ReserveLength()) {
                dynamic s = subject;
                thisIsTotesTheRealLegitThingReaderWriterThing.WriteThing(dest, s.Key);
                thisIsTotesTheRealLegitThingReaderWriterThing.WriteThing(dest, s.Value);
            }
        }
        public void WriteThing(SomeMemoryStreamWrapperThing dest, object subject)
        {
            dest.Write(fullTypeBinaryRepresentationCache.GetOrCompute(simplifiedCollectionType));

            using (dest.ReserveLength())
                using (var countReservation = dest.ReserveCount()) {
                    int count = 0;
                    foreach (var x in (IEnumerable)subject)
                    {
                        count++;
                        thingReaderWriterDispatcherThing.WriteThing(dest, x);
                    }
                    countReservation.SetValue(count);
                }
        }
Ejemplo n.º 3
0
 public void WriteFrame(SomeMemoryStreamWrapperThing dest, object subject)
 {
     using (dest.ReserveLength()) {
         thisIsTotesTheRealLegitThingReaderWriterThing.WriteThing(dest, subject);
     }
 }
 public void Write <T>(T val)
 {
     slotCount++;
     thisIsTotesTheRealLegitThingReaderWriterThing.WriteThing(dest, val);
 }