class RandomAccessFileInputStream extends InputStream {

  public void setRange(long rangeOffset, long rangeLength) throws IOException {
    if (rangeOffset < 0) {
      throw new IllegalArgumentException("rangeOffset must be >= 0");
    }
    if (rangeLength < 0) {
      throw new IllegalArgumentException("rangeLength must be >= 0");
    }
    if (rangeOffset + rangeLength > fileLength) {
      throw new IllegalArgumentException("Read range exceeds file length");
    }
    if (rangeOffset + rangeLength < 0) {
      throw new IllegalArgumentException("Insane input size not supported");
    }
    this.rangeOffset = rangeOffset;
    this.rangeLength = rangeLength;
    mark = rangeOffset;
    reset();
    mark = -1;
  }

  public  RandomAccessFileInputStream(File file);
  public  RandomAccessFileInputStream(File file, long rangeOffset, long rangeLength);

}