@Test void testBadBoundedStream() { final InputStream badInput = mock(InputStream.class, inv -> { throw new IOException("Expected exception"); }); assertThrows(IOException.class, () -> FileUtils.getBoundedStream(badInput, 4, 10)); }
public static InputStream getBoundedStream(final InputStream stream, final int from, final int to) throws IOException { final long skipped = stream.skip(from); LOGGER.debug("Skipped {} bytes", skipped); return new BoundedInputStream(stream, (long) to - from); }
FileUtils { public static InputStream getBoundedStream(final InputStream stream, final int from, final int to) throws IOException { final long skipped = stream.skip(from); LOGGER.debug("Skipped {} bytes", skipped); return new BoundedInputStream(stream, (long) to - from); } }
FileUtils { public static InputStream getBoundedStream(final InputStream stream, final int from, final int to) throws IOException { final long skipped = stream.skip(from); LOGGER.debug("Skipped {} bytes", skipped); return new BoundedInputStream(stream, (long) to - from); } private  FileUtils(); }
FileUtils { public static InputStream getBoundedStream(final InputStream stream, final int from, final int to) throws IOException { final long skipped = stream.skip(from); LOGGER.debug("Skipped {} bytes", skipped); return new BoundedInputStream(stream, (long) to - from); } private  FileUtils(); static File getResourceDirectory(final File baseDirectory, final IRI identifier); static Stream<Quad> parseQuad(final String line); static boolean filterServerManagedQuads(final Quad quad); static boolean uncheckedDeleteIfExists(final Path path); static Stream<Path> uncheckedList(final Path path); static void writeMemento(final File resourceDir, final Resource resource,
            final Instant time); static InputStream getBoundedStream(final InputStream stream, final int from, final int to); static String serializeQuad(final Quad quad); static File getNquadsFile(final File dir, final Instant time); }
FileUtils { public static InputStream getBoundedStream(final InputStream stream, final int from, final int to) throws IOException { final long skipped = stream.skip(from); LOGGER.debug("Skipped {} bytes", skipped); return new BoundedInputStream(stream, (long) to - from); } private  FileUtils(); static File getResourceDirectory(final File baseDirectory, final IRI identifier); static Stream<Quad> parseQuad(final String line); static boolean filterServerManagedQuads(final Quad quad); static boolean uncheckedDeleteIfExists(final Path path); static Stream<Path> uncheckedList(final Path path); static void writeMemento(final File resourceDir, final Resource resource,
            final Instant time); static InputStream getBoundedStream(final InputStream stream, final int from, final int to); static String serializeQuad(final Quad quad); static File getNquadsFile(final File dir, final Instant time); static final String CONFIG_FILE_LDP_TYPE; static final String CONFIG_FILE_DIGEST_ALGORITHM; static final int LENGTH; static final int MAX; }