public void flushBefore(final long pPosition) throws IOException { seekable.flushBefore(pPosition); }
public final void flush() throws IOException { flushBefore(flushedPosition); }
@Override public final void mark(int pLimit) { mark(); // TODO: We don't really need to do this.. Is it a good idea? try { flushBefore(Math.max(position - pLimit, flushedPosition)); } catch (IOException ignore) { // Ignore, as it's not really critical } }
@Test public void testFlushBeyondCurrentPos() throws Exception { SeekableInputStream seekable = makeInputStream(20); int pos = 10; try { seekable.flushBefore(pos); fail("Flush beyond current position should throw IndexOutOfBoundsException"); } catch (IndexOutOfBoundsException e) { // Ignore } }
public void flushBefore(final long pPosition) throws IOException { mSeekable.flushBefore(pPosition); }
public final void flush() throws IOException { flushBefore(mFlushedPosition); }
public void flushBefore(final long pPosition) throws IOException { seekable.flushBefore(pPosition); }
public final void flush() throws IOException { flushBefore(flushedPosition); }
@Test public void testSeekFlush() throws Exception { SeekableInputStream seekable = makeInputStream(133); int pos = 45; seekable.seek(pos); seekable.flushBefore(pos); long flushedPos = seekable.getFlushedPosition(); assertEquals("Flushed positon should match position", pos, flushedPos); try { seekable.seek(pos - 1); fail("Read before flushed position succeeded"); } catch (IndexOutOfBoundsException e) { // Ignore } }
@Test public void testMarkFlushReset() throws Exception { SeekableInputStream seekable = makeInputStream(77); seekable.mark(); int position = 55; seekable.seek(position); seekable.flushBefore(position); try { seekable.reset(); fail("Reset before flushed position succeeded"); } catch (IOException e) { // Ignore } assertEquals(position, seekable.getStreamPosition()); }
@Override public final void mark(int pLimit) { mark(); // TODO: We don't really need to do this.. Is it a good idea? try { flushBefore(Math.max(position - pLimit, flushedPosition)); } catch (IOException ignore) { // Ignore, as it's not really critical } }
@Override public final void mark(int pLimit) { mark(); // TODO: We don't really need to do this.. Is it a good idea? try { flushBefore(Math.max(mPosition - pLimit, mFlushedPosition)); } catch (IOException ignore) { // Ignore, as it's not really critical } }
public void testFlushBeyondCurrentPos() throws Exception { SeekableInputStream seekable = makeInputStream(20); int pos = 10; try { seekable.flushBefore(pos); fail("Flush beyond current position should throw IndexOutOfBoundsException"); } catch (IndexOutOfBoundsException e) { // Ignore } }
@Test public void testFlushBeyondCurrentPos() throws Exception { SeekableInputStream seekable = makeInputStream(20); int pos = 10; try { seekable.flushBefore(pos); fail("Flush beyond current position should throw IndexOutOfBoundsException"); } catch (IndexOutOfBoundsException e) { // Ignore } }
public void testSeekFlush() throws Exception { SeekableInputStream seekable = makeInputStream(133); int pos = 45; seekable.seek(pos); seekable.flushBefore(pos); long flushedPos = seekable.getFlushedPosition(); assertEquals("Flushed positon should match position", pos, flushedPos); try { seekable.seek(pos - 1); fail("Read before flushed position succeeded"); } catch (IndexOutOfBoundsException e) { // Ignore } }
public void testMarkFlushReset() throws Exception { SeekableInputStream seekable = makeInputStream(77); seekable.mark(); int position = 55; seekable.seek(position); seekable.flushBefore(position); try { seekable.reset(); fail("Reset before flushed position succeeded"); } catch (IOException e) { // Ignore } assertEquals(position, seekable.getStreamPosition()); }
@Test public void testSeekFlush() throws Exception { SeekableInputStream seekable = makeInputStream(133); int pos = 45; seekable.seek(pos); seekable.flushBefore(pos); long flushedPos = seekable.getFlushedPosition(); assertEquals("Flushed positon should match position", pos, flushedPos); try { seekable.seek(pos - 1); fail("Read before flushed position succeeded"); } catch (IndexOutOfBoundsException e) { // Ignore } }
@Test public void testMarkFlushReset() throws Exception { SeekableInputStream seekable = makeInputStream(77); seekable.mark(); int position = 55; seekable.seek(position); seekable.flushBefore(position); try { seekable.reset(); fail("Reset before flushed position succeeded"); } catch (IOException e) { // Ignore } assertEquals(position, seekable.getStreamPosition()); }