public bool Carve(long offsetLimit) { _state.Reset(); // Set default header(s) from detector configuration _reader.ReferenceHeaders = (_scanContext.ReferenceHeader as IDictionary <IDataPacket, ISequenceState>) ?? NoDefaultHeaders; // Note: This will not return extension, system end or user data start codes, // as these cannot occur at the start of a block. uint startCode; while ((startCode = _reader.NextStartCode()) != 0) { // Note: 0x100 is for picture headers, range 0x101..0x1af is for slices if ((startCode <= 0x1af) || (startCode == SequenceHeader.SequenceStartCode) || (startCode == GroupOfPicturesHeader.GopStartCode)) { return(true); } _reader.FlushBits(24); } return(false); }