Example #1
0
 // IEnumerable<Slice> accessor, assumes that this fragment has been read-in.
 // index starts at _startIndex (it is the index of the slice in the track, not index in this fragment)
 public override Slice this[int index]
 {
     get
     {
         if (index < _startIndex)
         {
             return(null);
         }
         if (_listOfSampleInfo == null)
         {
             return(null);
         }
         StreamDataBlockInfo sampleInfo = _listOfSampleInfo[index - _startIndex];
         Slice slice = new Slice();
         StreamDataBlockInfo sliceInfo = slice as StreamDataBlockInfo;
         sliceInfo.Copy(sampleInfo);
         _reader.BaseStream.Position = (long)sampleInfo.StreamOffset;
         slice.SliceBytes            = _reader.ReadBytes(sampleInfo.SliceSize); // return the actual bits from MDAT
         slice.SliceSize             = slice.SliceBytes.Length;
         return(slice);
     }
     set // this can work only with ODT fragments because each fragment is its own file
     {
         // if original frag has not been read-in yet, do nothing
         if (_listOfSampleInfo == null)
         {
             return;
         }
         FixupBoxesAndMDAT(index, value);
     }
 }
Example #2
0
 public override void Read(BoxReader reader)
 {
     using (SizeChecker checker = new SizeChecker(this, reader))
     {
       base.Read(reader);
         UserType = reader.ReadBytes(4);
                     UserData = reader.ReadBytes((int)checker.DataLeft());
     }
 }
Example #3
0
 public override void Read(BoxReader reader)
 {
     using (SizeChecker checker = new SizeChecker(this, reader))
     {
         base.Read(reader);
         UserType = reader.ReadBytes(4);
         UserData = reader.ReadBytes((int)checker.DataLeft());
     }
 }
 public override void Read(BoxReader reader)
 {
     base.Read(reader);
       reader.ReadBytes(6); // unsinged int(8)[6] reserved = 0
       DataReferenceIndex = reader.ReadUInt16();
 }