@Override public Array deserialize(String topic, byte[] data) { try { return ARRAY_READER.readArray(bytesToString(data)); } catch (IOException e) { // Should never see this, but shit if we do ... throw new RuntimeException(e); } }
protected void readAsStringAndBytes( String resourceFile ) throws IOException { String content = Testing.Files.readResourceAsString(resourceFile); Array doc = ArrayReader.defaultReader().readArray(content); byte[] bytes = SERDES.serialize("topicA",doc); Array reconstituted = SERDES.deserialize("topicA",bytes); assertThat((Object)reconstituted).isEqualTo(doc); }
@Override public Array deserialize(String topic, byte[] data) { try { return ARRAY_READER.readArray(bytesToString(data)); } catch (IOException e) { // Should never see this, but shit if we do ... throw new RuntimeException(e); } }