Checks to see if the transfer encoding in a specified {@link HttpMessage} is chunked

@param message The message to check
@return True if transfer encoding is chunked, otherwise false
435165
public static boolean isTransferEncodingChunked(HttpMessage message) {
        return message.headers().contains(HttpHeaderNames.TRANSFER_ENCODING, HttpHeaderValues.CHUNKED, true);
    }
1173823
public IoBuffer encode(Object message) throws Exception {
        if (message != null) {
            try {
                return encodePacket((Packet) message);
            } catch (Exception e) {
                log.error("Error encoding", e);
            }
        } else if (log.isDebugEnabled()) {
            try {
                String callingMethod = Thread.currentThread().getStackTrace()[4].getMethodName();
                log.debug("Message is null at encode, expecting a Packet from: {}", callingMethod);
            } catch (Throwable t) {
                log.warn("Problem getting current calling method from stacktrace", t);
            }
        }
        return null;
    }
602973
public void transmit(Object message) {
		try {
			boolean commandFlushed = false;
			byte[] b = (byte[]) message;
			for (int i = 0; i < b.length; i++) {
				byte b2 = b[i];
				if ((b2 == 10 || b2 == 13) && !commandFlushed) //NEWLINE / RETURN
				{
					commandFlushed = true;
					if ("exit".equals(command.toString().trim())) {
						close();
					}
					else {
						command.append((char) 10);//.append((char)13);
						proc.getOutputStream().write(command.toString().getBytes());
						proc.getOutputStream().flush();
						command = new StringBuffer();
					}
				}
				else// if (b2 != 13)
				{
					command = command.append((char) b2);
				}
			}
		}
		catch (IOException e) {
//			e.printStackTrace();
			close();
		}
	}
1209750
public Observable<Boolean> handleMessage(final ChatMessage message) {

        String sender = message.getSentBy();

        Observable<Boolean> replaceMessages = persistenceController.updateStoreWithNewMessage(message, noConversationListener);

        if (!TextUtils.isEmpty(sender) && !sender.equals(getProfileId())) {

            final Set<String> ids = new HashSet<>();
            ids.add(message.getMessageId());

            return Observable.zip(replaceMessages, markDelivered(message.getConversationId(), ids), (saved, result) -> saved && result.isSuccessful());

        } else {

            return replaceMessages;
        }
    }
363386
def _has_message(self):
        
        sep = protocol.MINIMAL_LINE_SEPARATOR.encode(self.encoding)
        return sep in self._receive_buffer
263559
public boolean isSendRemoteMessage(BaseMessage message)
    {
        Iterator<BaseMessageFilter> iterator = this.getMessageFilterList().getFilterList(null);    // ALL The filters (not just matches).
        while (iterator.hasNext())
        {
            BaseMessageFilter filter = iterator.next();
            if (!filter.isRemoteFilter())   // Always send down when filter is a remote copy
                if (filter.isSendRemoteMessage(message) == false)
                    return false;      // Don't send this message down
        }
        return true;
    }
265168
public static boolean isNotationMarker(MetaMessage message) {
		return
        	(message.getType()==MidiMessageType.MARKER &&
        			message.getData()[0]==MidiMessageType.NOTATION_MARKER);
	}
329505
@Override
  public boolean acceptInboundMessage(Object msg) throws Exception {
    if (msg instanceof ChunkFetchRequest) {
      return false;
    } else {
      return super.acceptInboundMessage(msg);
    }
  }
612438
public void processHttpRequestMessage(HttpMessage message) {
		// Get the session tokens for this site
		HttpSessionTokensSet siteTokensSet = extension.getHttpSessionTokensSet(getSite());

		// No tokens for this site, so no processing
		if (siteTokensSet == null) {
			log.debug("No session tokens for: " + this.getSite());
			return;
		}

		// Get the matching session, based on the request header
		List<HttpCookie> requestCookies = message.getRequestHeader().getHttpCookies();
		HttpSession session = getMatchingHttpSession(requestCookies, siteTokensSet);
		if (log.isDebugEnabled()) {
			log.debug("Matching session for request message (for site " + getSite() + "): " + session);
		}

		// If any session is active (forced), change the necessary cookies
		if (activeSession != null && activeSession != session) {
			CookieBasedSessionManagementHelper.processMessageToMatchSession(message, requestCookies,
					activeSession);
		} else {
			if (activeSession == session) {
				log.debug("Session of request message is the same as the active session, so no request changes needed.");
			} else {
				log.debug("No active session is selected.");
			}

			// Store the session in the HttpMessage for caching purpose
			message.setHttpSession(session);
		}
	}
527572
private boolean useChunkEncoding(SignableRequest<?> request) {
        // If chunked encoding is explicitly disabled through client options return right here.
        // Chunked encoding only makes sense to do when the payload is signed
        if (!isPayloadSigningEnabled(request) || isChunkedEncodingDisabled(request)) {
            return false;
        }
        if (request.getOriginalRequestObject() instanceof PutObjectRequest
                || request.getOriginalRequestObject() instanceof UploadPartRequest) {
            return true;
        }
        return false;
    }
91589
protected boolean containsRel100(Message message) {
		ListIterator<SIPHeader> requireHeaders = message.getHeaders(RequireHeader.NAME);
		if(requireHeaders != null) {
			while (requireHeaders.hasNext()) {
				if(REL100_OPTION_TAG.equals(requireHeaders.next().getValue())) {
					return true;
				}
			}
		}
		ListIterator<SIPHeader> supportedHeaders = message.getHeaders(SupportedHeader.NAME);
		if(supportedHeaders != null) {
			while (supportedHeaders.hasNext()) {
				if(REL100_OPTION_TAG.equals(supportedHeaders.next().getValue())) {
					return true;
				}
			}
		}
		return false;
	}
760303
public boolean isSendRemoteMessage(BaseMessage message)
    {
        if (message instanceof RecordMessage)   // Always
        {
            RecordMessageHeader recMessageHeader = (RecordMessageHeader)message.getMessageHeader();
            int iChangeType = recMessageHeader.getRecordMessageType();
            if (m_iDatabaseType == recMessageHeader.getDatabaseType())
                if (DBParams.CLIENT.equals(recMessageHeader.getSourceType()))   // Don't send only if Client DB is handling these messages.
            {
                if (!(this instanceof GridRecordMessageFilter))
                    if ((iChangeType == DBConstants.AFTER_UPDATE_TYPE)
                        || (iChangeType == DBConstants.AFTER_ADD_TYPE)
                        || (iChangeType == DBConstants.AFTER_DELETE_TYPE))
                            return false;    // The remote version of me handles this message remotely.
                if (this instanceof GridRecordMessageFilter)
                    if (iChangeType == DBConstants.AFTER_REQUERY_TYPE)
                        return false;    // The remote version of me handles this message remotely.
            }
        }
        return super.isSendRemoteMessage(message);
    }
155145
public static boolean hasProtocol(Message message, String protocolNamespace) {
        List<ExtensionElement> extensionElements = message.getExtensions(
                ExplicitMessageEncryptionElement.ELEMENT,
                ExplicitMessageEncryptionElement.NAMESPACE);

        for (ExtensionElement extensionElement : extensionElements) {
            ExplicitMessageEncryptionElement e = (ExplicitMessageEncryptionElement) extensionElement;
            if (e.getEncryptionNamespace().equals(protocolNamespace)) {
                return true;
            }
        }

        return false;
    }
231851
@Override
	public Response checkMessagingConnectionForTheDm( String message ) {

		this.logger.fine( "Request: check the connection to the message queue. message=" + message );
		Response response;
		String lang = lang( this.manager );
		if( this.manager.debugMngr().pingMessageQueue( message ))
			response = handleError( Status.OK, new RestError( REST_DEBUG_AGENT_KO, name( "ECHO" ), value( message )), lang ).build();
		else
			response = handleError( Status.INTERNAL_SERVER_ERROR, new RestError( REST_MESSAGING_ERROR ), lang ).build();

		return response;
	}
656672
public static boolean isXHTMLMessage(Message message) {
        return message.getExtension(XHTMLExtension.ELEMENT, XHTMLExtension.NAMESPACE) != null;
    }
476052
public String digest(String message) {
		final byte[] messageAsByteArray;

		try {
			messageAsByteArray = message.getBytes(charsetName);
		} catch (UnsupportedEncodingException e) {
			throw new DigestException("error converting message to byte array: charsetName=" + charsetName, e);
		}

		final byte[] digest = digest(messageAsByteArray);

		switch (outputMode) {
			case BASE64:
				return Base64.encodeBase64String(digest);
			case HEX:
				return Hex.encodeHexString(digest);
			default:
				return null;
		}
	}
20574
protected boolean processMessage(final SIBusMessage message) 
    {
      Reliability preInvokeMessageReliability = (Reliability)_reliabilityPreInvoke.get(message.getMessageHandle());
      boolean canDeleteMessage;
      if (preInvokeMessageReliability != null)
      {
        canDeleteMessage = (_unrecoverableReliability.compareTo(preInvokeMessageReliability) >= 0);
      }
      else  // if the pre invoke reliability is not in the map then go back to using the message which most of the time wil be fine
      {
        canDeleteMessage = (_unrecoverableReliability.compareTo(message.getReliability()) >= 0);
      }

      return !(_deleteUnrecoverableMessages && canDeleteMessage);

    }