static void OutputChunk(Context ctx, object chunk)
{
AssertChunkObject(chunk);
if (chunk.GetType() == typeof(string)) ctx.Output.Write((string)chunk);
else if (chunk.GetType() == typeof(byte[])) ctx.OutputStream.Write((byte[])chunk);
else if (chunk.GetType() == typeof(PhpString)) ((PhpString)chunk).Output(ctx);
else if (chunk.GetType() == typeof(char[])) ctx.Output.Write((char[])chunk);
else throw new ArgumentException();
}