/** * Creates a new {@link IRandomAccessSource} by reading the specified file/resource into memory * @param filename the name of the resource to read * @return the newly created {@link IRandomAccessSource} * @throws java.io.IOException if reading the underling file or stream fails */ private IRandomAccessSource createByReadingToMemory(String filename) throws java.io.IOException { InputStream stream = ResourceUtil.getResourceStream(filename); if (stream == null) { throw new java.io.IOException(MessageFormatUtil.format(IOException._1NotFoundAsFileOrResource, filename)); } return createByReadingToMemory(stream); }
/** * Creates a new {@link IRandomAccessSource} by reading the specified file/resource into memory * @param filename the name of the resource to read * @return the newly created {@link IRandomAccessSource} * @throws java.io.IOException if reading the underling file or stream fails */ private IRandomAccessSource createByReadingToMemory(String filename) throws java.io.IOException { InputStream stream = ResourceUtil.getResourceStream(filename); if (stream == null) { throw new java.io.IOException(MessageFormatUtil.format(IOException._1NotFoundAsFileOrResource, filename)); } return createByReadingToMemory(stream); }
return createSource(new URL(filename)); } else { return createByReadingToMemory(filename); return createByReadingToMemory(new FileInputStream(filename));
return createSource(new URL(filename)); } else { return createByReadingToMemory(filename); return createByReadingToMemory(new FileInputStream(filename));