コード例 #1
0
        public int ReadFrom(byte[] buffer, int offset)
        {
            ForwardLink  = Utilities.ToUInt32BigEndian(buffer, offset + 0);
            BackwardLink = Utilities.ToUInt32BigEndian(buffer, offset + 4);
            Kind         = (BTreeNodeKind)buffer[offset + 8];
            Height       = buffer[offset + 9];
            NumRecords   = Utilities.ToUInt16BigEndian(buffer, offset + 10);
            Reserved     = Utilities.ToUInt16BigEndian(buffer, offset + 12);

            return(14);
        }
コード例 #2
0
        public int ReadFrom(byte[] buffer, int offset)
        {
            ForwardLink = Utilities.ToUInt32BigEndian(buffer, offset + 0);
            BackwardLink = Utilities.ToUInt32BigEndian(buffer, offset + 4);
            Kind = (BTreeNodeKind)buffer[offset + 8];
            Height = buffer[offset + 9];
            NumRecords = Utilities.ToUInt16BigEndian(buffer, offset + 10);
            Reserved = Utilities.ToUInt16BigEndian(buffer, offset + 12);

            return 14;
        }
コード例 #3
0
        public void ReadNode_ThrowsOnInvalidKind(BTreeNodeKind kind)
        {
            var descriptor = new BTreeNodeDescriptor();

            descriptor.Kind = kind;

            byte[] data = new byte[descriptor.Size];
            descriptor.WriteTo(data, 0);

            var tree = new BTree <ExtentKey>(this.buffer);

            Assert.Throws <NotImplementedException>(() => BTreeNode.ReadNode(tree, data, 0));
        }