@Test public void testWrapUnknownLength() throws IOException { SubImageInputStream stream = new SubImageInputStream(new ImageInputStreamImpl() { @Override public int read() throws IOException { throw new UnsupportedOperationException("Method read not implemented"); } @Override public int read(byte[] b, int off, int len) throws IOException { throw new UnsupportedOperationException("Method read not implemented"); } @Override public long length() { return -1; } }, 6); assertEquals(-1, stream.length()); }
@Test public void testWraphBeyondWrappedLength() throws IOException { SubImageInputStream stream = new SubImageInputStream(createStream(5), 6); assertEquals(5, stream.length()); }
public void testWrapUnknownLength() throws IOException { SubImageInputStream stream = new SubImageInputStream(new ImageInputStreamImpl() { @Override public int read() throws IOException { throw new UnsupportedOperationException("Method read not implemented"); } @Override public int read(byte[] b, int off, int len) throws IOException { throw new UnsupportedOperationException("Method read not implemented"); } @Override public long length() { return -1; } }, 6); assertEquals(-1, stream.length()); }
public void testWrapUnknownLength() throws IOException { SubImageInputStream stream = new SubImageInputStream(new ImageInputStreamImpl() { @Override public int read() throws IOException { throw new UnsupportedOperationException("Method read not implemented"); } @Override public int read(byte[] b, int off, int len) throws IOException { throw new UnsupportedOperationException("Method read not implemented"); } @Override public long length() { return -1; } }, 6); assertEquals(-1, stream.length()); }
public void testWraphBeyondWrappedLength() throws IOException { SubImageInputStream stream = new SubImageInputStream(createStream(5), 6); assertEquals(5, stream.length()); }
public void testWraphBeyondWrappedLength() throws IOException { SubImageInputStream stream = new SubImageInputStream(createStream(5), 6); assertEquals(5, stream.length()); }