public class MapBytesUtility
extends java.lang.Object
string key/value pairs
to/from byte arrays containing JSON strings. By default the
JSON library encodes to UTF-8.Constructor and Description |
---|
MapBytesUtility()
Construct a MapBytesUtility.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
toByteArray(java.util.Map<java.lang.String,java.lang.String> map)
Convert a map of string key/value pairs to a JSON string in a byte array.
|
java.util.Map<java.lang.String,java.lang.String> |
toMap(byte[] bytes)
Convert a byte array containing a JSON string to a map of key/value pairs.
|
public byte[] toByteArray(java.util.Map<java.lang.String,java.lang.String> map)
map
- map to convertpublic java.util.Map<java.lang.String,java.lang.String> toMap(byte[] bytes)
bytes
- byte array containing the key/value pair strings