Pchp.Core.PhpString.GetCharInChunk C# (CSharp) 메소드

GetCharInChunk() 개인적인 메소드

private GetCharInChunk ( object chunk, int index ) : char
chunk object
index int
리턴 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());
        }