@Override
  public synchronized void reset() throws IOException {
    if (!in.markSupported()) {
      throw new IOException("Mark not supported");
    }
    if (mark == -1) {
      throw new IOException("Mark not set");
    }

    in.reset();
    left = mark;
  }
@Test(expected = IOException.class)
  public void testResetWithoutMark() throws IOException {
    try (LimitInputStream limitInputStream =
      new LimitInputStream(new RandomInputStream(), 128)) {
      limitInputStream.reset();
    }
  }