Receives and returns <code>size</code> Strings from the queue.
Presumes that messages in queue are {@link TextMessage}.

@param maxSize maximum number of messages to receive
@return <code>size</code> messages from the queue.
321794
public List<String> receiveTextMessages(int maxSize) {
        List<String> messages = new ArrayList<>();
        try {
            while (messages.size() <= maxSize){
                TextMessage message = (TextMessage) consumer.receive(timeout);
                if (message == null) {
                    return messages;
                }else {
                    messages.add(message.getText());
                }
            }
        } catch (JMSException e) {
            throw new AsyncException(e);
        }
        return messages;
    }
76566
private void parseLimitMessageSize(Map<Object, Object> props) {
        Object value = props.get(HttpConfigConstants.PROPNAME_MSG_SIZE_LIMIT);
        if (null != value) {
            try {
                this.limitMessageSize = convertLong(value);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "Config: Message size limit is " + getMessageSizeLimit());
                }
            } catch (NumberFormatException nfe) {
                FFDCFilter.processException(nfe, getClass().getName() + ".parseLimitMessageSize", "1");
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "Config: Invalid message size limit; " + value);
                }
            }
        }
    }
814495
public Long getMaxFileSize()
   {
      if (childNode.getTextValueForPatternName("max-file-size") != null && !childNode.getTextValueForPatternName("max-file-size").equals("null")) {
         return Long.valueOf(childNode.getTextValueForPatternName("max-file-size"));
      }
      return null;
   }
240538
func MaxMessageSize(max int) Opt {
	return func(r *reader) {
		buf := make([]byte, max>>1)
		r.Buffer(buf, max)
		r.maxf = max
	}
}
329411
public static String ENDPOINT_MAX_MESSAGE_SIZE_TOO_LONG(Object arg0, Object arg1, Object arg2, Object arg3) {
        return localizer.localize(localizableENDPOINT_MAX_MESSAGE_SIZE_TOO_LONG(arg0, arg1, arg2, arg3));
    }
727458
static Map<String, Object> sizePayload(final Object min, final Object max) {
		if (min == null || max == null) {
			return null;
		}
		Map<String, Object> payload = new LinkedHashMap<>();
		payload.put("min", min);
		payload.put("max", max);
		payload.put("message", MSG_PREFIX + VALIDATORS.get(Size.class));
		return payload;
	}
1075597
public function setMaxSizeMessage($maxSizeMessage)
    {
        if (!is_string($maxSizeMessage)) {
            throw new \InvalidArgumentException('The attribute maxSizeMessage on the class Attribute has to be string (' . gettype($maxSizeMessage) . ('object' === gettype($maxSizeMessage) ? ' ' . get_class($maxSizeMessage) : '') . ' given).');
        }

        $this->maxSizeMessage = $maxSizeMessage;

        return $this;
    }
408000
public void readContentTo(OutputStream os, long maxSize) throws IOException {
        setToResponseBodyStart();
        byte[] buf = new byte[4096];
        int c = read(buf);
        long tot = 0;
        while (c != -1 && tot < maxSize) {
            os.write(buf,0,c);
            c = read(buf);
            tot += c;
        }
    }
179671
public int getMessageLength(){
		// Message type, number of transients
		int length = 1 + 4;
		if(this.requests != null){
			for(OnDemandRequest request : this.requests){
				length += request.getLength();
			}
		}
		
		return length;
	}
1254831
public static function getMaxUploadSize($maxSize = null)
    {
        $maxUpload = (int)(ini_get('upload_max_filesize'));
        $maxPost = (int)(ini_get('post_max_size'));
        $memoryLimit = (int)(ini_get('memory_limit'));
        $min = min($maxUpload, $maxPost, $memoryLimit);
        if ($maxSize) {
            $maxSize = (int)$maxSize;
            return min($maxSize, $min);
        }
        return $min;
    }
1250830
public int size() {
        int retval=0;
        for(int i=0; i < index; i++)
            if(messages[i] != null)
                retval++;
        return retval;
    }
129331
function(msgs) {
  var size = 0;
  _.each(msgs, function(msg) {
    size += 8 + 4;
    size += messageByteSize(msg);
  });
  return size;
}
1304428
public Elasticsearch bulkFlushMaxSize(String maxSize) {
		internalProperties.putMemorySize(CONNECTOR_BULK_FLUSH_MAX_SIZE, MemorySize.parse(maxSize, MemorySize.MemoryUnit.BYTES));
		return this;
	}
938840
public SeqnoList getMissing(int max_msgs) {
        lock.lock();
        try {
            if(size == 0)
                return null;
            long start_seqno=getHighestDeliverable() +1;
            int capacity=(int)(hr - start_seqno);
            int max_size=max_msgs > 0? Math.min(max_msgs, capacity) : capacity;
            if(max_size <= 0)
                return null;
            Missing missing=new Missing(start_seqno, max_size);
            long to=max_size > 0? Math.min(start_seqno + max_size-1, hr-1) : hr-1;
            forEach(start_seqno, to, missing);
            return missing.getMissingElements();
        }
        finally {
            lock.unlock();
        }
    }
139539
long parseMaxLogSize (String maxLogSizeStr) {
		long maxLogSize = SizeRollingFileHandler.DEFAULT_LOG_SIZE_BOUND;

		if (maxLogSizeStr != null) {
			maxLogSizeStr = maxLogSizeStr.trim ().toUpperCase ();
			
			if (maxLogSizeStr.endsWith ("T")) {
				maxLogSizeStr = maxLogSizeStr.substring (0, maxLogSizeStr.length () - 1);
				try {
					maxLogSize = Long.parseLong (maxLogSizeStr) * 1024L * 1024L * 1024L * 1024L;
				} catch (NumberFormatException ex) {
					LogHelperDebug.printError ("Could not parse a long in " + maxLogSizeStr, ex, false);
				}
			} else if (maxLogSizeStr.endsWith ("G")) {
				maxLogSizeStr = maxLogSizeStr.substring (0, maxLogSizeStr.length () - 1);
				try {
					maxLogSize = Long.parseLong (maxLogSizeStr) * 1024L * 1024L * 1024L;
				} catch (NumberFormatException ex) {
					LogHelperDebug.printError ("Could not parse a long in " + maxLogSizeStr, ex, false);
				}
			} else if (maxLogSizeStr.endsWith ("M")) {
				maxLogSizeStr = maxLogSizeStr.substring (0, maxLogSizeStr.length () - 1);
				try {
					maxLogSize = Long.parseLong (maxLogSizeStr) * 1024L * 1024L;
				} catch (NumberFormatException ex) {
					LogHelperDebug.printError ("Could not parse a long in " + maxLogSizeStr, ex, false);
				}
			} else if (maxLogSizeStr.endsWith ("K")) {
				maxLogSizeStr = maxLogSizeStr.substring (0, maxLogSizeStr.length () - 1);
				try {
					maxLogSize = Long.parseLong (maxLogSizeStr) * 1024L;
				} catch (NumberFormatException ex) {
					LogHelperDebug.printError ("Could not parse a long in " + maxLogSizeStr, ex, false);
				}
			} else {
				try {
					maxLogSize = Long.parseLong (maxLogSizeStr);
				} catch (NumberFormatException ex) {
					LogHelperDebug.printError ("Could not parse a long in " + maxLogSizeStr, ex, false);
				}
			}
		}
		return maxLogSize;
	}
1099770
@Override
	public int size(T t) throws IOException {
		int size = 0;
		for (FieldInfo fieldInfo : fieldInfos) {
			Object value = FieldUtils.getField(t, fieldInfo.getField());
			// to check required
			if (value == null) {
				if (fieldInfo.isRequired()) {
					throw new UninitializedMessageException(CodedConstant.asList(fieldInfo.getField().getName()));
				}
			} else {
				size += computeSize(fieldInfo, value);
			}

		}
		return size;
	}
1320161
public final int getNewBufferSize(int curSize, int minNewSize) {
      if (curSize <= maxDoublingSize)
         return Math.max(curSize << 1, minNewSize);
      else
         return Math.max(curSize + (curSize >> 2), minNewSize);
   }