private Map<String, String> toMap(byte[] bytes) {
			if (bytes == null || bytes.length == 0) {
				return Collections.emptyMap();
			}
			try {
				return reader.readValue(bytes);
			}
			catch (Exception e) {
				String contents;
				try {
					contents = new String(bytes, "UTF-8");
				}
				catch (UnsupportedEncodingException uue) {
					contents = "Could not read content due to " + uue;
				}
				throw new RuntimeException("Error parsing JSON string: " + contents, e);
			}
		}
Convert a byte array containing a JSON string to a map of key/value pairs.

@param bytes byte array containing the key/value pair strings

@return a new map instance containing the key/value pairs
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/zookeeper/ZooKeeperUtils.java