GitSharp.Core.ObjectId.FromRaw C# (CSharp) Method

FromRaw() public static method

public static FromRaw ( byte buffer ) : ObjectId
buffer byte
return ObjectId
        public static ObjectId FromRaw(byte[] buffer)
        {
            return FromRaw(buffer, 0);
        }

Same methods

ObjectId::FromRaw ( byte buffer, int offset ) : ObjectId
ObjectId::FromRaw ( int intbuffer ) : ObjectId
ObjectId::FromRaw ( int intbuffer, int offset ) : ObjectId

Usage Example

Example #1
0
        public override ObjectId GetObjectId(long nthPosition)
        {
            int  levelOne = Array.BinarySearch(_fanoutTable, nthPosition + 1);
            long lbase;

            if (levelOne >= 0)
            {
                // If we hit the bucket exactly the item is in the bucket, or
                // any bucket before it which has the same object count.
                //
                lbase = _fanoutTable[levelOne];
                while (levelOne > 0 && lbase == _fanoutTable[levelOne - 1])
                {
                    levelOne--;
                }
            }
            else
            {
                // The item is in the bucket we would insert it into.
                //
                levelOne = -(levelOne + 1);
            }

            lbase = levelOne > 0 ? _fanoutTable[levelOne - 1] : 0;
            var p  = (int)(nthPosition - lbase);
            int p4 = p << 2;

            return(ObjectId.FromRaw(_names[levelOne], p4 + p));            // p * 5
        }
All Usage Examples Of GitSharp.Core.ObjectId::FromRaw