ByteArrayDeserializer extends TypeDeserializer<byte[]> { @Override protected byte[] deserialize(InputStream stream, Charset charset) throws Exception { return IOs.toByteArray(stream, true); }    }
@Test public void shouldDeserializeToByteArray() throws Exception { String s = "hello"; assertArrayEquals(s.getBytes(), deserialize(toTest, s)); }