public int drainTo(@NotNull ByteBufQueue dest, int maxSize) {
		int s = maxSize;
		while (s != 0 && hasRemaining()) {
			ByteBuf buf = takeAtMost(s);
			dest.add(buf);
			s -= buf.readRemaining();
		}
		return maxSize - s;
	}
public int drainTo ( @ NotNull ByteBufQueue dest , int maxSize ) { int s = maxSize ; while ( s != 0 && hasRemaining ( ) ) { ByteBuf buf = takeAtMost ( s ) ; dest . add ( buf ) ; s -= buf . readRemaining ( ) ; } return maxSize - s ; }
Adds to ByteBufQueue {@code dest} {@code maxSize} bytes from this queue.
If this queue doesn't contain enough bytes, adds all bytes from this queue.

@param dest    {@code ByteBufQueue} for draining
@param maxSize number of bytes for adding
@return number of added elements