(String input)
| 240 | } |
| 241 | |
| 242 | public static byte[] encode(String input) throws Exception { |
| 243 | ObjectMapper mapper = new ObjectMapper(); |
| 244 | mapper.enable(JsonParser.Feature.STRICT_DUPLICATE_DETECTION); |
| 245 | HashMap<String, Object> messages = mapper.readValue(input, new TypeReference<HashMap<String, Object>>() { |
| 246 | }); |
| 247 | return encodeData(messages); |
| 248 | } |
| 249 | |
| 250 | public static boolean decodeData(ByteArrayInputStream data, Map<String, Object> messages) throws Exception { |
| 251 | int ordinary = 0; |