Bytes

Concurrent Bytes Array

The Bytes contract is a concurrent array specialized for storing bytes data. It inherits from the Base contract to utilize container functionalities for bytes storage.

Constructor

Bytes()

constructor()

Constructor for the Bytes contract.

Public Functions

push

function push(bytes memory elem) public virtual

Add a bytes data element to the concurrent array.

  • Parameters:

    • elem: The bytes data element to add to the array.

pop

function pop() public virtual returns (bytes memory)

Remove and return the last bytes data element from the concurrent array.

  • Returns:

    • bytes memory: The last bytes data element from the array.

get

function get(uint256 idx) public virtual returns (bytes memory)

Retrieve the bytes data element at the given index from the concurrent array.

  • Parameters:

    • idx: The index of the bytes data element to retrieve.

  • Returns:

    • bytes memory: The bytes data element stored at the given index.

set

function set(uint256 idx, bytes memory elem) public

Set the bytes data element at the given index in the concurrent array.

  • Parameters:

    • idx: The index where the bytes data element should be stored.

    • elem: The bytes data element to be stored at the specified index.

Last updated