Package software.amazon.awssdk.crt.http
Class HttpHeader
- java.lang.Object
-
- software.amazon.awssdk.crt.http.HttpHeader
-
public class HttpHeader extends Object
A wrapper class for http header key-value pairs
-
-
Constructor Summary
Constructors Constructor Description HttpHeader(byte[] name, byte[] value)
HttpHeader(String name, String value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getName()
byte[]
getNameBytes()
String
getValue()
byte[]
getValueBytes()
static HttpHeader[]
loadHeadersFromMarshalledHeadersBlob(ByteBuffer headersBlob)
static List<HttpHeader>
loadHeadersListFromMarshalledHeadersBlob(ByteBuffer headersBlob)
Each header is marshalled as [4-bytes BE name length] [variable length name value] [4-bytes BE value length] [variable length value value]static byte[]
marshalHeadersForJni(List<HttpHeader> headers)
Lists of headers are marshalled as follows: each string field is: [4-bytes BE] [variable length bytes specified by the previous field]String
toString()
-
-
-
Method Detail
-
getName
public String getName()
- Returns:
- the name of the header, converted to a UTF-8 string
-
getNameBytes
public byte[] getNameBytes()
- Returns:
- the name of the header, in raw bytes
-
getValue
public String getValue()
- Returns:
- the value of the header, converted to a UTF-8 string
-
getValueBytes
public byte[] getValueBytes()
- Returns:
- the value of the header, in raw bytes
-
loadHeadersListFromMarshalledHeadersBlob
public static List<HttpHeader> loadHeadersListFromMarshalledHeadersBlob(ByteBuffer headersBlob)
Each header is marshalled as [4-bytes BE name length] [variable length name value] [4-bytes BE value length] [variable length value value]- Parameters:
headersBlob
- Blob of encoded headers- Returns:
- array of decoded headers
-
marshalHeadersForJni
public static byte[] marshalHeadersForJni(List<HttpHeader> headers)
Lists of headers are marshalled as follows: each string field is: [4-bytes BE] [variable length bytes specified by the previous field]- Parameters:
headers
- List of header name-value pairs- Returns:
- encoded blob of headers
-
loadHeadersFromMarshalledHeadersBlob
public static HttpHeader[] loadHeadersFromMarshalledHeadersBlob(ByteBuffer headersBlob)
- Parameters:
headersBlob
- encoded headers blob- Returns:
- array of headers
- See Also:
loadHeadersListFromMarshalledHeadersBlob(java.nio.ByteBuffer)
-
-