if (toUni instanceof PRStream){
try {
byte[] touni = PdfReader.getStreamBytes((PRStream)toUni);
CMapParser cmapParser = new CMapParser();
toUnicodeCmap = cmapParser.parse(new ByteArrayInputStream(touni));
} catch (IOException e) {
// technically, we should log this or provide some sort of feedback... but sometimes the cmap will be junk, but it's still possible to get text, so we don't want to throw an exception
//throw new IllegalStateException("Unable to process ToUnicode map - " + e.getMessage(), e);
}
}