/// <summary>
        /// ctor: Create class from data returned by the Reader
        /// </summary>
        /// <param name="reader">A binary data reader for this type of data - positioned at last page</param>
        public p4kEndOfCentralDirRecord(p4kRecReader reader)
        {
            // sanity check only
            System.Diagnostics.Trace.Assert(Marshal.SizeOf(typeof(MyRecord)) == RecordLength,
                                            "Record size does not match!(" + Marshal.SizeOf(typeof(MyRecord)).ToString( ) + ")");

            if (reader.IsOpen( ))
            {
                try {
                    long thisPos = 0;
                    // 20180804BM- fix when the last page is barely used and the sig is one or more pages before
                    //  - backup one or more pages to find end of dir (max 10 times)
                    int tries = 10;
                    while (!m_itemValid && (tries > 0))
                    {
                        thisPos = reader.Position;
                        long cPos = p4kSignatures.FindSignatureInPage(reader, p4kSignatures.EndOfCentralDirRecord);
                        if (cPos >= 0)
                        {
                            m_recordOffset = cPos;
                            reader.Seek(cPos);
                            m_item      = p4kRecReader.ByteToType <MyRecord>(reader.TheReader);
                            m_itemValid = true;
                        }
                        else
                        {
                            // backup one page again
                            reader.Seek(thisPos);
                            reader.BackwardPage( );
                            tries--;
                        }
                    }
                }
                catch {
                    m_itemValid    = false;
                    m_recordOffset = -1;
                }
                finally {
                    if (!m_itemValid)
                    {
                        throw new OperationCanceledException(string.Format("EOF - cannot find EndOfCentralDirRecord"));
                    }
                }
            }
        }