public void Write(IExtendedBinaryWriter writer)
 {
     writer.Write(DataSource);
     writer.Write(IsArray);
     writer.WriteOpt(JsonStrings.Length);
     foreach (var jsonString in JsonStrings)
     {
         writer.Write(jsonString);
     }
 }
Beispiel #2
0
        public void Write(IExtendedBinaryWriter writer)
        {
            writer.WriteOptAscii(Id);
            writer.WriteOptAscii(AnnotationType);
            writer.WriteOptAscii(SaAltAllele);
            writer.Write(IsPositional);

            if (StringFields != null)
            {
                writer.WriteOpt(StringFields.Count);
                foreach (var stringField in StringFields)
                {
                    writer.WriteOptAscii(stringField.Key);
                    writer.WriteOptAscii(stringField.Value);
                }
            }
            else
            {
                writer.WriteOpt(0);
            }

            if (BooleanFields != null)
            {
                writer.WriteOpt(BooleanFields.Count);
                foreach (var booleanField in BooleanFields)
                {
                    writer.WriteOptAscii(booleanField);
                }
            }
            else
            {
                writer.WriteOpt(0);
            }
        }
Beispiel #3
0
 public void Write(IExtendedBinaryWriter writer)
 {
     writer.WriteOpt(Chromosome.Index);
     writer.WriteOpt(Start);
     writer.WriteOpt(End);
     writer.Write((byte)Type);
     // ReSharper disable once ImpureMethodCallOnReadonlyValueField
     Id.Write(writer);
 }
Beispiel #4
0
 public void Write(IExtendedBinaryWriter writer)
 {
     writer.Write((byte)Type);
     writer.WriteOpt(Id);
     writer.WriteOpt(Start);
     writer.WriteOpt(End);
     writer.WriteOpt(CdnaStart);
     writer.WriteOpt(CdnaEnd);
 }
Beispiel #5
0
 public void Write(IExtendedBinaryWriter writer)
 {
     writer.Write(GeneName);
     writer.WriteOpt(Annotations.Length);
     for (int i = 0; i < Annotations.Length; i++)
     {
         Annotations[i].Write(writer);
     }
 }
Beispiel #6
0
 public void Write(IExtendedBinaryWriter writer)
 {
     writer.WriteOpt(Chromosome.Index);
     writer.WriteOpt(Start);
     writer.WriteOpt(End);
     writer.Write(OnReverseStrand);
     writer.WriteOptAscii(Symbol);
     writer.WriteOpt(HgncId);
     // ReSharper disable ImpureMethodCallOnReadonlyValueField
     EntrezGeneId.Write(writer);
     EnsemblId.Write(writer);
 }
Beispiel #7
0
        public void Write(IExtendedBinaryWriter writer)
        {
            writer.Write(KeyName);
            writer.Write(VcfkeyName);
            writer.Write(AltAllele);

            byte flags = 0;

            if (MatchByAllele)
            {
                flags |= 1;
            }
            if (IsArray)
            {
                flags |= 2;
            }
            writer.Write(flags);

            writer.Write(VcfString);

            writer.WriteOpt(JsonStrings.Length);
            foreach (var jsonString in JsonStrings)
            {
                writer.Write(jsonString);
            }
        }
        internal static void WriteItems <T>(IExtendedBinaryWriter writer, IReadOnlyCollection <T> items, Action <T> writeMethod)
        {
            if (items == null)
            {
                writer.WriteOpt(0);
            }
            else
            {
                writer.WriteOpt(items.Count);
                foreach (var item in items)
                {
                    writeMethod(item);
                }
            }

            writer.Write(CacheConstants.GuardInt);
        }
        private static void WriteIntervals <T>(IExtendedBinaryWriter writer, IReadOnlyCollection <IntervalArray <T> > intervalArrays,
                                               Action <T> writeMethod)
        {
            writer.WriteOpt(intervalArrays.Count);

            foreach (var intervalArray in intervalArrays)
            {
                if (intervalArray == null)
                {
                    writer.WriteOpt(0);
                    continue;
                }

                writer.WriteOpt(intervalArray.Array.Length);
                foreach (var interval in intervalArray.Array)
                {
                    writeMethod(interval.Value);
                }
            }

            writer.Write(CacheConstants.GuardInt);
        }
Beispiel #10
0
 internal void Write(IExtendedBinaryWriter writer)
 {
     writer.Write(_info);
     writer.Write(_contents);
 }
Beispiel #11
0
 public void Write(IExtendedBinaryWriter writer)
 {
     writer.Write((byte)_id);
     writer.Write(_version);
     writer.Write(_info);
 }
 private void WriteBuffer(IExtendedBinaryWriter writer)
 {
     writer.WriteOpt(_buffer.Length);
     writer.Write(_buffer);
 }