private static List<COSObject> getListOfNames(COSObject object) {
   if (object.getType() == COSObjType.COS_ARRAY) {
     List<COSObject> names = new ArrayList<>();
     for (int i = 0; i < object.size(); ++i) {
       names.add(object.at(i));
     }
   }
   return null;
 }
 private static ASInputStream getLookup(COSObject object) {
   COSObjType type = object.getType();
   if (type == COSObjType.COS_STRING) {
     return new ASMemoryInStream(object.getString().getBytes());
   } else if (type == COSObjType.COS_STREAM) {
     return object.getData(COSStream.FilterFlags.DECODE);
   } else {
     if (!object.empty()) {
       LOGGER.debug("Unknown lookup type");
     }
     return null;
   }
 }
 public static PDColorSpace getColorSpace(COSObject base) {
   if (base == null) {
     return null;
   }
   COSObjType type = base.getType();
   if (type == COSObjType.COS_NAME) {
     return getColorSpaceFromName(base);
   } else if (type == COSObjType.COS_ARRAY) {
     return getColorSpaceFromArray(base);
   } else if (type == COSObjType.COS_DICT || type == COSObjType.COS_STREAM) {
     return getPattern(base);
   } else {
     LOGGER.debug("COSObject has to be a name or array, but it is not");
     return null;
   }
 }