ByteStream.cs 579 B

12345678910111213141516171819
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5. using System.Text;
  6. namespace MatrixIO.IO.MpegTs.Streams
  7. {
  8. public class ByteStream : TsStream<byte[]>
  9. {
  10. protected override byte[] ProcessUnit(TsUnit unit)
  11. {
  12. // TODO: We should think about passing the unit payload in as an IList for speed. It complicates copying chunks of data, however.
  13. var unitPayload = new byte[unit.Payload.Count];
  14. unit.Payload.CopyTo(unitPayload, 0);
  15. return unitPayload;
  16. }
  17. }
  18. }