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