@Test public void testSeekBeforeStreamNoEnd() throws IOException { byte[] bytes = new byte[20]; MemoryCacheImageInputStream input = new MemoryCacheImageInputStream(new ByteArrayInputStream(bytes)); input.seek(10); assertEquals(10, input.getStreamPosition()); IIOInputStreamAdapter stream = new IIOInputStreamAdapter(input); assertEquals("Should not skip backwards", 0, stream.skip(-5)); assertEquals(10, input.getStreamPosition()); }
@Test public void testSeekBeforeStream() throws IOException { byte[] bytes = new byte[20]; MemoryCacheImageInputStream input = new MemoryCacheImageInputStream(new ByteArrayInputStream(bytes)); input.seek(10); assertEquals(10, input.getStreamPosition()); IIOInputStreamAdapter stream = new IIOInputStreamAdapter(input, 9); assertEquals("Should not skip backwards", 0, stream.skip(-5)); assertEquals(10, input.getStreamPosition()); } }
public void testSeekBeforeStream() throws IOException { byte[] bytes = new byte[20]; MemoryCacheImageInputStream input = new MemoryCacheImageInputStream(new ByteArrayInputStream(bytes)); input.seek(10); assertEquals(10, input.getStreamPosition()); IIOInputStreamAdapter stream = new IIOInputStreamAdapter(input, 9); assertEquals("Should not skip backwards", 0, stream.skip(-5)); assertEquals(10, input.getStreamPosition()); } }
public void testSeekBeforeStreamNoEnd() throws IOException { byte[] bytes = new byte[20]; MemoryCacheImageInputStream input = new MemoryCacheImageInputStream(new ByteArrayInputStream(bytes)); input.seek(10); assertEquals(10, input.getStreamPosition()); IIOInputStreamAdapter stream = new IIOInputStreamAdapter(input); assertEquals("Should not skip backwards", 0, stream.skip(-5)); assertEquals(10, input.getStreamPosition()); }
@Test public void testSeekBeforeStream() throws IOException { byte[] bytes = new byte[20]; MemoryCacheImageInputStream input = new MemoryCacheImageInputStream(new ByteArrayInputStream(bytes)); input.seek(10); assertEquals(10, input.getStreamPosition()); IIOInputStreamAdapter stream = new IIOInputStreamAdapter(input, 9); assertEquals("Should not skip backwards", 0, stream.skip(-5)); assertEquals(10, input.getStreamPosition()); } }
@Test public void testSeekBeforeStreamNoEnd() throws IOException { byte[] bytes = new byte[20]; MemoryCacheImageInputStream input = new MemoryCacheImageInputStream(new ByteArrayInputStream(bytes)); input.seek(10); assertEquals(10, input.getStreamPosition()); IIOInputStreamAdapter stream = new IIOInputStreamAdapter(input); assertEquals("Should not skip backwards", 0, stream.skip(-5)); assertEquals(10, input.getStreamPosition()); }