Exemple #1
0
        private void PutFormatVersion(PageCursor cursor)
        {
            GenericLayout layout = Layout;
            int           major  = layout.MajorVersion();

            cursor.PutInt(major);
            int minor = layout.MinorVersion();

            cursor.PutInt(minor);
        }
Exemple #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: protected void verifyFormat(java.io.File storeFile) throws FormatViolationException, java.io.IOException
        protected internal override void VerifyFormat(File storeFile)
        {
            AtomicReference <FormatViolationException> exception = new AtomicReference <FormatViolationException>();

            WithCursor(storeFile, false, c =>
            {
                int major            = c.Int;
                int minor            = c.Int;
                GenericLayout layout = Layout;
                if (major != layout.MajorVersion() || minor != layout.MinorVersion())
                {
                    exception.set(new FormatViolationException(this, string.Format("Read format version {0:D}.{1:D}, but layout has version {2:D}.{3:D}", major, minor, layout.MajorVersion(), layout.MinorVersion())));
                }
            });
            if (exception.get() != null)
            {
                throw exception.get();
            }
        }