Seeks to a position in the music. For streaming music, seeking before the current position causes
the stream to be reloaded.

@param position Position in seconds.
@return True if the seek was successful
493414
public boolean setPosition(float position) {
		if (playing) {
			requiredPosition = -1;
			
			positioning = true;
			playing = false;
			boolean result = sound.setPosition(position);
			playing = true;
			positioning = false;

			return result;
		} else {
			requiredPosition = position;
			return false;
		}
	}
266234
final public void addPosition(int position) {
    if (tokenPosition == null) {
      tokenPosition = new MtasPosition(position);
    } else {
      tokenPosition.add(position);
    }
  }
7649
private void seekQuietly(long positiveTargetPos) {
    try {
      seek(positiveTargetPos);
    } catch (IOException ioe) {
      LOG.debug("Ignoring IOE on seek of {} to {}",
          uri, positiveTargetPos, ioe);
    }
  }
1325550
@Override
    public boolean advanceNextPosition()
    {
        boolean needNextRows = !started || !nextRows.hasNext();

        if (!started) {
            started = true;
            nanoStart = System.nanoTime();
        }

        if (needNextRows) {
            currentRow = null;
            try {
                do {
                    if (!scanner.hasMoreRows()) {
                        return false;
                    }

                    nextRows = scanner.nextRows();
                }
                while (!nextRows.hasNext());
                log.debug("Fetched " + nextRows.getNumRows() + " rows");
            }
            catch (KuduException e) {
                throw new RuntimeException(e);
            }
        }

        currentRow = nextRows.next();
        totalBytes += getRowLength();
        return true;
    }
289298
private void seekToCurrentPlayback() {
        if (engine.isPullMode()) {
            try {
                // TODO: figure out if this is the correct position to seek to
                final long delta = System.currentTimeMillis() - engine.getPlaybackStart();
                engine.seek((int) delta);
            } catch (OperationNotSupportedException err) {
                // Ignore error, should not happen for pullMode engines
            }
        }
    }
923680
public boolean absolute(int position) {

        if (position < 0) {
            position += size;
        }

        if (position < 0) {
            beforeFirst();

            return false;
        }

        if (position > size) {
            afterLast();

            return false;
        }

        if (size == 0) {
            return false;
        }

        if (position < currentPos) {
            beforeFirst();
        }

        // go to the tagget row;
        while (position > currentPos) {
            next();
        }

        return true;
    }
553673
private long getCurrentPosition() {
        long pos;
        if (!useLoadBuf) {
            return in.position();
        }
        try {
            if (in != null) {
                pos = (channel.position() - in.remaining());
            } else {
                pos = channel.position();
            }
            return pos;
        } catch (Exception e) {
            log.error("Error getCurrentPosition", e);
            return 0;
        }
    }
184863
public function seek($position)
    {
        if (!isset($this->tokens[$position])) {
            throw $this->getOutOfBoundsException($position);
        }

        $this->position = $position;
    }
1090136
public function seek($position)
    {
        if ($position > $this->getStream()->getSize()) {
            throw new OutOfBoundsException('Invalid seek position ('.$position.')');
        }

        $this->getStream()->seek($position, SEEK_SET);
    }
140660
public boolean setPosition(float position) {
		try {
			if (getPosition() > position) {
				initStreams();
			}

			float sampleRate = audio.getRate();
			float sampleSize;
			if (audio.getChannels() > 1) {
				sampleSize = 4; // AL10.AL_FORMAT_STEREO16
			} else {
				sampleSize = 2; // AL10.AL_FORMAT_MONO16
			}

			while (positionOffset < position) {
				int count = audio.read(buffer);
				if (count != -1) {
					float bufferLength = (count / sampleSize) / sampleRate;
					positionOffset += bufferLength;
				} else {
					if (loop) {
						initStreams();
					} else {
						done = true;
					}
					return false;
				}
			}

			startPlayback(); 

			return true;
		} catch (IOException e) {
			Log.error(e);
			return false;
		}
	}
363729
public void updatePosition(final BitfinexPosition position) {
		
		synchronized (positions) {
			// Replace position
			positions.removeIf(p -> p.getCurrencyPair() == position.getCurrencyPair());
			positions.add(position);
			positions.notifyAll();
		}
		
		notifyCallbacks(position);
	}
124145
public void seek(int offset) throws IOException {
    if (!(offset >= bufferOffset && offset < bufferOffset + maxBufferSize)) {
      writeBuffer();
      newBuffer(offset);
      aFile.seek(offset);
    }
    position = offset;
  }
520008
public final void update(final float position) {
        if (reset) {
            reset = false;
            distance = 0;
            thresholdReachedPosition = -1;
            dragStartTime = -1;
            dragStartPosition = position;
            reachedThreshold = false;
            minDragDistance = 0;
            maxDragDistance = 0;
        }

        if (!reachedThreshold) {
            if (reachedThreshold(position - dragStartPosition)) {
                dragStartTime = System.currentTimeMillis();
                reachedThreshold = true;
                thresholdReachedPosition = position;
            }
        } else {
            float newDistance = position - thresholdReachedPosition;

            if (minDragDistance != 0 && minDragDistance > newDistance) {
                newDistance = minDragDistance;
                thresholdReachedPosition = position - minDragDistance;
            }

            if (maxDragDistance != 0 && maxDragDistance < newDistance) {
                newDistance = maxDragDistance;
                thresholdReachedPosition = position - maxDragDistance;
            }

            distance = newDistance;
        }
    }
1048718
public final void seek(long pPosition) throws IOException {
        checkOpen();

        // TODO: This is correct according to javax.imageio (IndexOutOfBoundsException),
        // but it's inconsistent with reset that throws IOException...
        if (pPosition < flushedPosition) {
            throw new IndexOutOfBoundsException("position < flushedPosition!");
        }

        seekImpl(pPosition);
        position = pPosition;
    }
1156168
public boolean next() {
        checkState();
        if (mPlayerPlaylist.isEmpty()) {
            return false;
        }
        PlaybackService.play(getContext(), mClientKey, mPlayerPlaylist.next());
        return true;
    }
318461
function stream_seek($offset, $whence)
    {
        if ($whence == SEEK_SET && $offset >= 0) {
            $this->pos = $offset;
        } elseif ($whence == SEEK_CUR && -$offset <= $this->pos) {
            $this->pos += $offset;
        } elseif ($whence == SEEK_END && -$offset <= sizeof($this->data)) {
            $this->pos = strlen($this->data) + $offset;
        } else {
            return false;
        }
        return true;
    }
450113
def seek(self, position):
        
        self._position = position
        range_string = make_range_string(self._position)
        logger.debug('content_length: %r range_string: %r', self._content_length, range_string)

        #
        # Close old body explicitly.
        # When first seek(), self._body is not exist. Catch the exception and do nothing.
        #
        try:
            self._body.close()
        except AttributeError:
            pass

        if position == self._content_length == 0 or position == self._content_length:
            #
            # When reading, we can't seek to the first byte of an empty file.
            # Similarly, we can't seek past the last byte.  Do nothing here.
            #
            self._body = io.BytesIO()
        else:
            self._body = self._object.get(Range=range_string)['Body']