System.Globalization.CultureTable.CheckAndGetTheString C# (CSharp) Method

CheckAndGetTheString() private static method

private static CheckAndGetTheString ( ushort pDataPool, uint offsetInPool, int poolSize ) : String
pDataPool ushort
offsetInPool uint
poolSize int
return String
        private unsafe static String CheckAndGetTheString(ushort *pDataPool, uint offsetInPool, int poolSize)
        {
            if (offsetInPool + 2 > poolSize)  // string offset + string length + null termination.
                return null;
                
            char* pCharValues = unchecked((char*)(pDataPool + offsetInPool));
            int stringLength = (int) pCharValues[0];
            if (offsetInPool + stringLength + 2 > poolSize) // string length + string + null termination
                return null;
                
            return new String(pCharValues + 1, 0, stringLength);
        }