How do I create a DeviceN color space?

Q: A related question (to 'How can I can create ICC PDF color space')
is how do I support n-channels (when there's more than 4)?
----
A: To create a color space with more than 4 channels you could create
a DeviceN color space:

Obj devicen = pdfdoc.CreateIndirectArray();
devicen.PushBackName("DeviceN");

Obj names_arr = devicen.PushBackArray();
names_arr.PushBackName("Color1");
names_arr.PushBackName("Color2");
names_arr.PushBackName("Color3");
names_arr.PushBackName("Color4");
names_arr.PushBackName("Color5");
names_arr.PushBackName("Color6");

// Alternate color space
devicen.PushBackName("DeviceCMYK");

Obj tint_transfrom = pdfdoc.CreateIndirectDict();
... create the function object that
... transform colorants from DeviceN to CMYK
devicen.PushBack (tint_transfrom);

// Now use the color space...
// Create a high-level color space....
ColorSpace cs = new ColorSpace(devicen);