Class BencodedList

    • Constructor Detail

      • BencodedList

        public BencodedList()
        Creates a new empty bencoded list.
    • Method Detail

      • get

        public IBencodedValue get​(int index)
        Gets an item from the bencoded list.
        Parameters:
        index - The index to get the item at.
        Returns:
        The item at the given index.
      • add

        public void add​(IBencodedValue value)
        Adds a value to the bencoded list.
        Parameters:
        value - The value to add.
      • size

        public int size()
        Returns:
        The amount of bencoded items in this list.
      • serialize

        public byte[] serialize()
        Returns:
        The value represented in bencoded format.