/** * Creates a new {@link RandomAccessSource} by reading the specified file/resource into memory * @param filename the name of the resource to read * @return the newly created {@link RandomAccessSource} * @throws IOException if reading the underling file or stream fails */ private IRandomAccessSource CreateByReadingToMemory(String filename) { //TODO: seems odd that we are using BaseFont here... Stream inp = StreamUtil.GetResourceStream(filename); if (inp == null) throw new IOException(MessageLocalization.GetComposedMessage("1.not.found.as.file.or.resource", filename)); return CreateByReadingToMemory(inp); }