ScrewTurn.Wiki.IndexStorer.ReadCount C# (CSharp) Method

ReadCount() private static method

Reads the count in a FileStream.
The caller must properly seek the stream after calling the method.
private static ReadCount ( FileStream fs ) : int
fs System.IO.FileStream The , at position zero.
return int
        private static int ReadCount(FileStream fs)
        {
            BinaryReader reader = new BinaryReader(fs, Encoding.UTF8);
            if(!ReadReserved(reader)) {
                throw new InvalidOperationException("Invalid index file header");
            }
            return reader.ReadInt32();
        }