code: public static int lastIndexOf(ByteBuffer buffer, byte valueToFind, int startIndex)
  	    {
  	        assert buffer != null;
  
  	        if (startIndex < buffer.position())
  	        {
  	            return -1;
  	        }
  	        else if (startIndex >= buffer.limit())
  	        {
  	            startIndex = buffer.limit() - 1;
  	        }
  
  	        for (int i = startIndex; i >= buffer.position(); i--)
  	        {
  	            if (valueToFind == buffer.get(i))
  	                return i;
  	        }
  
  	        return -1;
  	    }
docs: ByteBuffer adaptation of org.apache.commons.lang.ArrayUtils.lastIndexOf method
  
  @param buffer the array to traverse for looking for the object, may be <code>null</code>
  @param valueToFind the value to find
  @param startIndex the start index (i.e. BB position) to travers backwards from
  @return the last index (i.e. BB position) of the value within the array
  [between buffer.position() and buffer.limit()]; <code>-1</code> if not found.