public static void WriteQuatretConsistancy(List <Quartet> Listq, PartitionStatus status, string pHeader) { StringBuilder sb = new StringBuilder(); if (!string.IsNullOrEmpty(pHeader)) { sb.AppendLine(pHeader); } var vIsoConsistent = Listq.FindAll(x => x._ConsistancyStatus == ConsistencyStatus.Consistent); var vIsoInConsistent = Listq.FindAll(x => x._ConsistancyStatus == ConsistencyStatus.InConsistent); if (status == PartitionStatus.Differed) { sb.AppendLine("----------------Differed Quatret" + "(" + Listq.Count.ToString() + ")" + "-----------------"); } else if (status == PartitionStatus.Isolated) { sb.AppendLine("----------------Isolated Quatret" + "(" + Listq.Count.ToString() + ")" + "-----------------"); } else if (status == PartitionStatus.Viotated) { sb.AppendLine("----------------Viotated Quatret" + "(" + Listq.Count.ToString() + ")" + "-----------------"); } else { sb.AppendLine("----------------ALL Quatret" + "(" + Listq.Count.ToString() + ")" + "-----------------"); } sb.AppendLine("Consistent Quatret List:" + "(" + vIsoConsistent.Count.ToString() + ")"); string val = ""; foreach (Quartet q in vIsoConsistent) { val = val + q._Quartet_Input + " "; } sb.AppendLine(val); sb.AppendLine("InConsistent Quatret List:" + "(" + vIsoInConsistent.Count.ToString() + ")"); val = ""; foreach (Quartet q in vIsoInConsistent) { val = val + q._Quartet_Input + " "; } sb.AppendLine(val); File.AppendAllText(Constant.OutputFilePath, sb.ToString()); }
public KlvPacket(Stream stream) { // read 16-bytes key Key = new byte[KeySize]; int read = stream.Read(Key, 0, Key.Length); if (read < Key.Length) { throw new Exception("MXF KLV packet - stream does not have 16 bytes available for key"); } int lengthSize; DataSize = GetBasicEncodingRuleLength(stream, out lengthSize); DataPosition = stream.Position; TotalSize = KeySize + lengthSize + DataSize; if (Key[14] >= 1 && Key[14] <= 4) { PartionStatus = (PartitionStatus)Key[14]; } }