private void checkBufferLimits() { Integer contentLength = this.expectedContentLength; if (contentLength != null && contentLength > this.bufferSizeLimit) { throw new StompConversionException( "STOMP 'content-length' header value " + this.expectedContentLength + " exceeds configured buffer size limit " + this.bufferSizeLimit); } if (getBufferSize() > this.bufferSizeLimit) { throw new StompConversionException("The configured STOMP buffer size limit of " + this.bufferSizeLimit + " bytes has been exceeded"); } }
/** * Try to read an EOL incrementing the buffer position if successful. * @return whether an EOL was consumed */ private boolean tryConsumeEndOfLine(ByteBuffer byteBuffer) { if (byteBuffer.remaining() > 0) { byte b = byteBuffer.get(); if (b == '\n') { return true; } else if (b == '\r') { if (byteBuffer.remaining() > 0 && byteBuffer.get() == '\n') { return true; } else { throw new StompConversionException("'\\r' must be followed by '\\n'"); } } // Explicit cast for compatibility with covariant return type on JDK 9's ByteBuffer ((Buffer) byteBuffer).position(byteBuffer.position() - 1); } return false; }
sb.append(inString.substring(pos, index)); if (index + 1 >= inString.length()) { throw new StompConversionException("Illegal escape sequence at index " + index + ": " + inString); throw new StompConversionException("Illegal escape sequence at index " + index + ": " + inString);
byteBuffer.get(payload); if (byteBuffer.get() != 0) { throw new StompConversionException("Frame must be terminated with a null octet");
if (colonIndex <= 0) { if (byteBuffer.remaining() > 0) { throw new StompConversionException("Illegal header: '" + header + "'. A header must be of the form <name>:[<value>].");
throw new StompConversionException("Failed to encode STOMP frame, headers=" + headers, ex);
StompCommand stompCommand = headerAccessor.getCommand(); if (stompCommand != null && !stompCommand.isBodyAllowed()) { throw new StompConversionException(stompCommand + " shouldn't have a payload: length=" + payload.length + ", headers=" + headers);
private void checkBufferLimits() { Integer contentLength = this.expectedContentLength; if (contentLength != null && contentLength > this.bufferSizeLimit) { throw new StompConversionException( "STOMP 'content-length' header value " + this.expectedContentLength + " exceeds configured buffer size limit " + this.bufferSizeLimit); } if (getBufferSize() > this.bufferSizeLimit) { throw new StompConversionException("The configured STOMP buffer size limit of " + this.bufferSizeLimit + " bytes has been exceeded"); } }
/** * Try to read an EOL incrementing the buffer position if successful. * @return whether an EOL was consumed */ private boolean tryConsumeEndOfLine(ByteBuffer byteBuffer) { if (byteBuffer.remaining() > 0) { byte b = byteBuffer.get(); if (b == '\n') { return true; } else if (b == '\r') { if (byteBuffer.remaining() > 0 && byteBuffer.get() == '\n') { return true; } else { throw new StompConversionException("'\\r' must be followed by '\\n'"); } } // Explicit cast for compatibility with covariant return type on JDK 9's ByteBuffer ((Buffer) byteBuffer).position(byteBuffer.position() - 1); } return false; }
sb.append(inString.substring(pos, index)); if (index + 1 >= inString.length()) { throw new StompConversionException("Illegal escape sequence at index " + index + ": " + inString); throw new StompConversionException("Illegal escape sequence at index " + index + ": " + inString);
byteBuffer.get(payload); if (byteBuffer.get() != 0) { throw new StompConversionException("Frame must be terminated with a null octet");
if (colonIndex <= 0) { if (byteBuffer.remaining() > 0) { throw new StompConversionException("Illegal header: '" + header + "'. A header must be of the form <name>:[<value>].");
throw new StompConversionException("Failed to encode STOMP frame, headers=" + headers, ex);
StompCommand stompCommand = headerAccessor.getCommand(); if (stompCommand != null && !stompCommand.isBodyAllowed()) { throw new StompConversionException(stompCommand + " shouldn't have a payload: length=" + payload.length + ", headers=" + headers);
private void checkBufferLimits() { Integer contentLength = this.expectedContentLength; if (contentLength != null && contentLength > this.bufferSizeLimit) { throw new StompConversionException( "STOMP 'content-length' header value " + this.expectedContentLength + " exceeds configured buffer size limit " + this.bufferSizeLimit); } if (getBufferSize() > this.bufferSizeLimit) { throw new StompConversionException("The configured STOMP buffer size limit of " + this.bufferSizeLimit + " bytes has been exceeded"); } }
private void checkBufferLimits() { Integer contentLength = this.expectedContentLength; if (contentLength != null && contentLength > this.bufferSizeLimit) { throw new StompConversionException( "STOMP 'content-length' header value " + this.expectedContentLength + " exceeds configured buffer size limit " + this.bufferSizeLimit); } if (getBufferSize() > this.bufferSizeLimit) { throw new StompConversionException("The configured STOMP buffer size limit of " + this.bufferSizeLimit + " bytes has been exceeded"); } }
/** * Try to read an EOL incrementing the buffer position if successful. * @return whether an EOL was consumed */ private boolean tryConsumeEndOfLine(ByteBuffer byteBuffer) { if (byteBuffer.remaining() > 0) { byte b = byteBuffer.get(); if (b == '\n') { return true; } else if (b == '\r') { if (byteBuffer.remaining() > 0 && byteBuffer.get() == '\n') { return true; } else { throw new StompConversionException("'\\r' must be followed by '\\n'"); } } // Explicit cast for compatibility with covariant return type on JDK 9's ByteBuffer ((Buffer) byteBuffer).position(byteBuffer.position() - 1); } return false; }
/** * Try to read an EOL incrementing the buffer position if successful. * @return whether an EOL was consumed */ private boolean tryConsumeEndOfLine(ByteBuffer byteBuffer) { if (byteBuffer.remaining() > 0) { byte b = byteBuffer.get(); if (b == '\n') { return true; } else if (b == '\r') { if (byteBuffer.remaining() > 0 && byteBuffer.get() == '\n') { return true; } else { throw new StompConversionException("'\\r' must be followed by '\\n'"); } } // Explicit cast for compatibility with covariant return type on JDK 9's ByteBuffer ((Buffer) byteBuffer).position(byteBuffer.position() - 1); } return false; }
sb.append(inString.substring(pos, index)); if (index + 1 >= inString.length()) { throw new StompConversionException("Illegal escape sequence at index " + index + ": " + inString); throw new StompConversionException("Illegal escape sequence at index " + index + ": " + inString);
throw new StompConversionException("Failed to encode STOMP frame, headers=" + headers, ex);