Class ByteArrayList


  • class ByteArrayList
    extends Object
    A linked list that stores ByteArrays and maintains several useful invariants. Note : this class is *not* thread safe.
    Author:
    Apache MINA Project
    • Constructor Detail

      • ByteArrayList

        protected ByteArrayList()
        Creates a new instance of ByteArrayList.
    • Method Detail

      • lastByte

        public int lastByte()
        Returns:
        The last byte in the array list
      • firstByte

        public int firstByte()
        Returns:
        The first byte in the array list
      • isEmpty

        public boolean isEmpty()
        Check to see if this is empty
        Returns:
        True if empty, otherwise false
      • getFirst

        public ByteArrayList.Node getFirst()
        Returns:
        the first node in the byte array
      • addFirst

        public void addFirst​(ByteArray ba)
        Adds the specified ByteArray to the beginning of the list
        Parameters:
        ba - The ByteArray to be added to the list
      • addLast

        public void addLast​(ByteArray ba)
        Add the specified ByteArray to the end of the list
        Parameters:
        ba - The ByteArray to be added to the list
      • removeFirst

        public ByteArrayList.Node removeFirst()
        Removes the first node from this list
        Returns:
        The node that was removed
      • removeLast

        public ByteArrayList.Node removeLast()
        Removes the last node in this list
        Returns:
        The node that was taken off of the list
      • addNode

        protected void addNode​(ByteArrayList.Node nodeToInsert,
                               ByteArrayList.Node insertBeforeNode)
        Inserts a new node into the list.
        Parameters:
        nodeToInsert - new node to insert
        insertBeforeNode - node to insert before