docs: public int drainTo(Collection<T> c, final int max_bytes) {
          if(c == null)
              throw new IllegalArgumentException("collection to drain elements to must not be null");
          if(max_bytes <= 0)
              return 0;
          int bytes=0;
          El<T> el;
          boolean at_least_one_removed=false;
          lock.lock();
          try {
              // go as long as there are elements in the queue or pending waiters
              while((el=queue.peek()) != null || waiters > 0) {
                  if(el != null) {
                      if(bytes + el.size > max_bytes)
                          break;
                      el=queue.poll();
                      at_least_one_removed=true;
                      count-=el.size;
                      bytes+=el.size;
                      c.add(el.el);
                  }
                  else { // queue is empty, wait on more elements to be added
                      not_full.signalAll(); // releases the waiters, causing them to add their elements to the queue
                      try {
                          not_empty.await();
                      }
                      catch(InterruptedException e) {
                          break;
                      }
                  }
              }
              if(at_least_one_removed)
                  not_full.signalAll();
              return bytes;
          }
          finally {
              lock.unlock();
          }
      }