BinarySearchSeeker.TimestampSearchResult


class BinarySearchSeeker.TimestampSearchResult


Represents possible search results for searchForTimestamp.

Summary

Constants

const BinarySearchSeeker.TimestampSearchResult!
const Int

The search didn't find any timestamps.

const Int

The search found only timestamps larger than the target timestamp.

const Int

The search found only timestamps smaller than the target timestamp.

const Int

The search found a timestamp that it deems close enough to the given target.

Public functions

java-static BinarySearchSeeker.TimestampSearchResult!
overestimatedResult(
    newCeilingTimestamp: Long,
    newCeilingBytePosition: Long
)

Returns a result to signal that the current position in the input stream overestimates the true position of the target frame, and the BinarySearchSeeker should modify its SeekOperationParams's ceiling timestamp and byte position using the given values.

java-static BinarySearchSeeker.TimestampSearchResult!
targetFoundResult(resultBytePosition: Long)

Returns a result to signal that the target timestamp has been found at resultBytePosition, and the seek operation can stop.

java-static BinarySearchSeeker.TimestampSearchResult!
underestimatedResult(
    newFloorTimestamp: Long,
    newCeilingBytePosition: Long
)

Returns a result to signal that the current position in the input stream underestimates the true position of the target frame, and the BinarySearchSeeker should modify its SeekOperationParams's floor timestamp and byte position using the given values.

Constants

NO_TIMESTAMP_IN_RANGE_RESULT

const val NO_TIMESTAMP_IN_RANGE_RESULTBinarySearchSeeker.TimestampSearchResult!

TYPE_NO_TIMESTAMP

const val TYPE_NO_TIMESTAMP = -3: Int

The search didn't find any timestamps.

TYPE_POSITION_OVERESTIMATED

const val TYPE_POSITION_OVERESTIMATED = -1: Int

The search found only timestamps larger than the target timestamp.

TYPE_POSITION_UNDERESTIMATED

const val TYPE_POSITION_UNDERESTIMATED = -2: Int

The search found only timestamps smaller than the target timestamp.

TYPE_TARGET_TIMESTAMP_FOUND

const val TYPE_TARGET_TIMESTAMP_FOUND = 0: Int

The search found a timestamp that it deems close enough to the given target.

Public functions

overestimatedResult

java-static fun overestimatedResult(
    newCeilingTimestamp: Long,
    newCeilingBytePosition: Long
): BinarySearchSeeker.TimestampSearchResult!

Returns a result to signal that the current position in the input stream overestimates the true position of the target frame, and the BinarySearchSeeker should modify its SeekOperationParams's ceiling timestamp and byte position using the given values.

targetFoundResult

java-static fun targetFoundResult(resultBytePosition: Long): BinarySearchSeeker.TimestampSearchResult!

Returns a result to signal that the target timestamp has been found at resultBytePosition, and the seek operation can stop.

underestimatedResult

java-static fun underestimatedResult(
    newFloorTimestamp: Long,
    newCeilingBytePosition: Long
): BinarySearchSeeker.TimestampSearchResult!

Returns a result to signal that the current position in the input stream underestimates the true position of the target frame, and the BinarySearchSeeker should modify its SeekOperationParams's floor timestamp and byte position using the given values.