### Question:
StreamSource extends RandomAccessStream { @Override public void moveTo(long position) throws IllegalArgumentException { if (position < 0 || length() < position) { throw new IllegalArgumentException("Position out of the bounds of the file!"); } fp = position; } StreamSource(SmbFile file, long l); void open(); @Override int read(); int read(byte[] bytes, int start, int offs); @Override void moveTo(long position); @Override void close(); String getMimeType(); String getName(); SmbFile getFile();  }### Answer:
@Test public void reset() throws IOException { ss.moveTo(10); assertEquals(text.length - 10, ss.availableExact()); ss.reset(); assertEquals(text.length, ss.availableExact()); }
@Test public void moveTo() throws IOException { int readPosition = text.length - 10; byte[] buff = new byte[1]; ss.moveTo(readPosition); ss.open(); int n = ss.read(buff); assertEquals(text[readPosition], buff[0]); assertEquals(buff.length, n); }
@Test public void available() throws IOException { int amount = 12; ss.moveTo(text.length - amount); assertEquals(amount, ss.availableExact()); }