EditRange

class EditRange(val data: ByteArray, start: Int, end: Int) : FileAction

EditRange is a FileAction that effectively first removes data from the stated range (with an exclusive upper bound), then splits the file and inserts the new data at the position where the first element was removed.

Author

Richard Arriaga

Parameters

data

The ByteArray that is to be inserted in the file.

start

The location in the file to insert/overwrite the data.

end

The location in the file to stop overwriting, exclusive. All data from this point should be preserved.

Constructors

Link copied to clipboard
constructor(data: ByteArray, start: Int, end: Int)

Construct an EditRange.

Properties

Link copied to clipboard

The ByteArray that is to be inserted in the file.

Link copied to clipboard
open override val isTraced: Boolean = true

true indicates this FileAction is traced in a TracedAction; false otherwise.

Link copied to clipboard
open override val type: FileActionType

The FileActionType that represents this FileAction.

Functions

Link copied to clipboard
open override fun execute(file: AvailFile, timestamp: Long, originator: UUID): TracedAction

Executes the action on the provided AvailFile and answer the TracedAction required to reverse this FileAction update.