1 #ifndef CRT_EVENT_STREAM_MESSAGE_H 2 #define CRT_EVENT_STREAM_MESSAGE_H 3 /** 4 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 5 * SPDX-License-Identifier: Apache-2.0. 6 */ 7 #include <jni.h> 8 9 #include <aws/common/byte_buf.h> 10 #include <aws/event-stream/event_stream_rpc.h> 11 12 struct aws_event_stream_rpc_marshalled_message { 13 struct aws_allocator *allocator; 14 bool headers_init; 15 struct aws_array_list headers_list; 16 struct aws_byte_buf headers_buf; 17 struct aws_byte_buf payload_buf; 18 struct aws_byte_buf operation_buf; 19 struct aws_event_stream_rpc_message_args message_args; 20 }; 21 22 int aws_event_stream_rpc_marshall_message_args_init( 23 struct aws_event_stream_rpc_marshalled_message *message_args, 24 struct aws_allocator *allocator, 25 JNIEnv *env, 26 jbyteArray headers, 27 jbyteArray payload, 28 jbyteArray operation, 29 jint message_flags, 30 jint message_type); 31 32 void aws_event_stream_rpc_marshall_message_args_clean_up(struct aws_event_stream_rpc_marshalled_message *message_args); 33 34 jbyteArray aws_event_stream_rpc_marshall_headers_to_byteArray( 35 struct aws_allocator *allocator, 36 JNIEnv *env, 37 struct aws_event_stream_header_value_pair *pair, 38 size_t length); 39 40 #endif /* CRT_EVENT_STREAM_MESSAGE_H */ 41