}
ColorModel cm = null;
if (colorspace instanceof PDIndexed)
{
PDIndexed csIndexed = (PDIndexed)colorspace;
// the base color space uses 8 bit per component, as the indexed color values
// of an indexed color space are always in a range from 0 to 255
ColorModel baseColorModel = csIndexed.getBaseColorSpace().createColorModel(8);
// number of possible color values in the target color space
int numberOfColorValues = 1 << bpc;
// number of indexed color values
int highValue = csIndexed.getHighValue();
// choose the correct size, sometimes there are more indexed values than needed
// and sometimes there are fewer indexed value than possible
int size = Math.min(numberOfColorValues-1, highValue);
byte[] index = csIndexed.getLookupData();
boolean hasAlpha = baseColorModel.hasAlpha();
COSBase maskArray = getMask();
if( baseColorModel.getTransferType() != DataBuffer.TYPE_BYTE )
{
throw new IOException( "Not implemented" );