Following up on
PDFBOX-4392 I have noticed ICC color spaces aren't being cached in the resource cache, since they are represented not by a `COSObject` but rather by a `COSArray` with `COSName` of `ICCBased` as the first element and a `COSObject` (the actual profile) as the second element.
This patch introduces a static `create` method to `PDICCBased` which optionally caches/retrieves the color space from cache. Accordingly, the constructor taking a `COSArray` has been made private, and the validity tests moved to the static `create` method.
Testing on the example from
PDFBOX-4392 the patch improves both time and memory consumption. Presumably it will help with any PDF with ICC-based profiles which are re-used by many images.