@Override
  public synchronized int read(long pos, byte[] b, int start, int len) throws IOException {
    this.pos = (int) pos;
    return read(b, start, len);
  }
@Test
  void randomReads() throws Exception {
    Random random = new Random(19820210);
    int length = random.nextInt(SIZE) + 1;
    byte[] data = new byte[length];
    random.nextBytes(data);

    Input in = new InputBytes(data);

    for (int i = 0; i < COUNT; i++) {
      int p = random.nextInt(length);
      int l = Math.min(random.nextInt(SIZE / 10), length - p);
      byte[] buffer = new byte[l];
      in.read(p, buffer, 0, l);
      assertArrayEquals(Arrays.copyOfRange(data, p, p + l), buffer);
    }
    in.close();
  }