public static IStream createFromObject(object array)
{
if (array.GetType().IsArray)
return new ArrayStream((Array)array);
// TODO: Decide if we want all the specialized types.
// TODO: make sure we don't have a multi-dim array
throw new ArgumentException(String.Format("Unsupported array type %s", array.GetType()));
}