//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private org.neo4j.kernel.impl.store.record.LabelTokenRecord readLabelTokenRecord(int id, org.neo4j.storageengine.api.ReadableChannel channel) throws java.io.IOException
        private LabelTokenRecord ReadLabelTokenRecord(int id, ReadableChannel channel)
        {
            // in_use(byte)+type_blockId(int)+nr_type_records(int)
            sbyte inUseFlag = channel.Get();
            bool  inUse     = false;

            if ((inUseFlag & Record.IN_USE.byteValue()) == Record.IN_USE.byteValue())
            {
                inUse = true;
            }
            else if (inUseFlag != Record.NOT_IN_USE.byteValue())
            {
                throw new IOException("Illegal in use flag: " + inUseFlag);
            }
            LabelTokenRecord record = new LabelTokenRecord(id);

            record.InUse  = inUse;
            record.NameId = channel.Int;
            int nrTypeRecords = channel.Int;

            for (int i = 0; i < nrTypeRecords; i++)
            {
                DynamicRecord dr = ReadDynamicRecord(channel);
                if (dr == null)
                {
                    return(null);
                }
                record.AddNameRecord(dr);
            }
            return(record);
        }
示例#2
0
        private LabelTokenRecord CreateLabelTokenRecord(int id)
        {
            LabelTokenRecord labelTokenRecord = new LabelTokenRecord(id);

            labelTokenRecord.InUse  = true;
            labelTokenRecord.NameId = 333;
            labelTokenRecord.AddNameRecord(new DynamicRecord(43));
            return(labelTokenRecord);
        }