void (Printer printer, @Nullable File file, List<? extends Printable> nestedPrintables) { if (file != null) { int lineNum = 0; Map<String, ConsoleViewContentType> contentTypeByNameMap = ContainerUtil.newMapFromValues( ConsoleViewContentType.getRegisteredTypes().iterator(), contentType -> contentType.toString() ); try (DataInputStream reader = new DataInputStream(new BufferedInputStream(new FileInputStream(file)))) { while (reader.available() > 0 && !wasPrintableChanged(printer)) { if (lineNum == CompositePrintable.this.getExceptionMark() && lineNum > 0) printer.mark(); final String firstToken = IOUtil.readString(reader); if (firstToken == null) break; if (firstToken.equals(HYPERLINK)) { createHyperlink(IOUtil.readString(reader), IOUtil.readString(reader), IOUtil.readString(reader), IOUtil.readString(reader), false).printOn(printer); } else { ConsoleViewContentType contentType = contentTypeByNameMap.getOrDefault(firstToken, ConsoleViewContentType.NORMAL_OUTPUT); String text = IOUtil.readString(reader); if (text != null) { printText(printer, text, contentType); } } lineNum++; } } catch (FileNotFoundException e) { LOG.info(e); } catch (IOException e) { LOG.error(e); } } for (int i = 0; i < nestedPrintables.size(); i++) { if (i == getExceptionMark() && i > 0) printer.mark(); nestedPrintables.get(i).printOn(printer); } }