Class Message
java.lang.Object
software.amazon.awssdk.eventstream.Message
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Messagedecode(ByteBuffer buf) voidencode(OutputStream os) static byte[]encodeHeaders(Iterable<Map.Entry<String, HeaderValue>> headers) Encode the givenheaders, without any leading or trailing metadata such as checksums or lengths.booleanReturns this message's headers.byte[]Returns this message's payload.inthashCode()toString()
-
Field Details
-
MESSAGE_OVERHEAD
public static final int MESSAGE_OVERHEAD- See Also:
-
-
Constructor Details
-
Message
Create a message.- Parameters:
headers- a non-null key-value map of headers, which will be encoded on the wire according to the iteration order of the given mappayload- a non-null byte array containing zero or more bytes
-
-
Method Details
-
getHeaders
Returns this message's headers. If this message was obtained throughdecode(ByteBuffer), the iteration order of the headers is guaranteed to match the order in which the headers appeared on the wire.- Returns:
- an unmodifiable non-null key-value map of this message's headers
-
getPayload
public byte[] getPayload()Returns this message's payload.- Returns:
- a non-null array of zero or more bytes
-
decode
-
toByteBuffer
-
encode
-
encodeHeaders
Encode the givenheaders, without any leading or trailing metadata such as checksums or lengths.- Parameters:
headers- a sequence of zero or more headers, which will be encoded in iteration order- Returns:
- a byte array corresponding to the
headerssection of aMessage
-
equals
-
hashCode
-
toString
-