code: protected void validatePosition(long position) throws IOException {
      if (position < 0) {
        throw new EOFException(
            String.format(
                "Invalid seek offset: position value (%d) must be >= 0 for '%s'",
                position, resourceIdString));
      }
  
      if (size >= 0 && position >= size) {
        throw new EOFException(
            String.format(
                "Invalid seek offset: position value (%d) must be between 0 and %d for '%s'",
                position, size, resourceIdString));
      }
    }
docs: Validates that the given position is valid for this channel.