public static void WriteDescriptors(TextWriter writer, byte[] buffer, int offset, int length) { while (length > 0) { if (length < 2) { writer.WriteLine("Unused buffer " + (object)length); break; } byte code = buffer[offset]; byte num = buffer[offset + 1]; offset += 2; length -= 2; TsDescriptorType descriptorType = TsDescriptorTypes.GetDescriptorType(code); if (null == descriptorType) { writer.Write((string)(object)code + (object)":Unknown"); } else { writer.Write((object)descriptorType); } if (length < (int)num) { writer.WriteLine(" " + (object)num + " exceeds buffer (" + (string)(object)length + " remaining)"); break; } length -= (int)num; offset += (int)num; } }
static TsDescriptorTypes() { TsDescriptorTypes.Validate(); }