BinRead() public method

public BinRead ( BinaryReader br ) : void
br System.IO.BinaryReader
return void
Example #1
0
        private void Open(string filename)
        {
            this._fs = new FileStream(filename, FileMode.Open);
            this._br = new BinaryReader(this._fs);

            this.Header = new TableHeader();
            this.Header.BinRead(this._br);

            this.Columns = new List <Column>();
            for (Int16 i = 0; i < this.Header.ColumnCount; i++)
            {
                Column c = new Column();
                c.BinRead(_br);
                this.Columns.Add(c);
            }

            // Read mysterious extra byte; found in original test
            // table from a Lotus Approach database.
            _br.ReadByte();
            // Sanity check row size
            if (this.CalculateTotalRowSize() != this.Header.RowLength)
            {
                throw new BadDataException("Total size of columns does not match that defined in the header");
            }
        }
Example #2
0
        private void Open(string filename)
        {
            this._fs = new FileStream(filename, FileMode.Open);
            this._br = new BinaryReader(this._fs);

            this.Header = new TableHeader();
            this.Header.BinRead(this._br);

            this.Columns = new List<Column>();
            for (Int16 i = 0; i < this.Header.ColumnCount; i++)
            {
                Column c = new Column();
                c.BinRead(_br);
                this.Columns.Add(c);
            }

            // Read mysterious extra byte; found in original test
            // table from a Lotus Approach database.
            _br.ReadByte();
            // Sanity check row size
            if (this.CalculateTotalRowSize() != this.Header.RowLength)
            {
                throw new BadDataException("Total size of columns does not match that defined in the header");
            }
        }