public final class ConnectionHeaders extends Object
String values. We use a pure text based format as this information
will be used to decide whether to accept a connection with the remote end, thus, until the connection has been
accepted we should not trust ObjectInputStream or an equivalent based mechanism for exchange of
pre-connection headers. We could use a header format equivalent to that of HTTP headers, the JSON format
of mapping two/from a Map with String keys and values has the advantages
Map and a JSON object
null keys and neither can a Map
null values and so can a Map
| Modifier and Type | Class and Description |
|---|---|
static class |
ConnectionHeaders.ParseException |
| Modifier and Type | Method and Description |
|---|---|
static void |
appendEscaped(StringBuilder b,
String str) |
static String |
encodeEscape(int c) |
static Map<String,String> |
fromString(String data)
Converts the headers from the String format.
|
static String |
toString(Map<String,String> data)
Converts the headers into the String format.
|
@Nonnull public static String toString(@Nonnull Map<String,String> data)
data - the headers.@Nonnull public static Map<String,String> fromString(@Nonnull String data) throws ConnectionHeaders.ParseException
data - the string encoded headers.ConnectionHeaders.ParseExceptionpublic static void appendEscaped(StringBuilder b, String str)
public static String encodeEscape(int c)
Copyright © 2004–2017. All rights reserved.