Pchp.Core.PhpString.GetCharInChunk C# (CSharp) Method

GetCharInChunk() private method

private GetCharInChunk ( object chunk, int index ) : char
chunk object
index int
return char
        char GetCharInChunk(object chunk, int index)
        {
            AssertChunkObject(chunk);

            if (chunk.GetType() == typeof(string)) return ((string)chunk)[index];
            if (chunk.GetType() == typeof(byte[])) return (char)((byte[])chunk)[index];
            if (chunk.GetType() == typeof(PhpString)) return ((PhpString)chunk)[index];
            if (chunk.GetType() == typeof(char[])) return ((char[])chunk)[index];

            throw new ArgumentException(chunk.GetType().ToString());
        }