StringDeserializer extends TypeDeserializer<String> { @Override protected String deserialize(InputStream stream, Charset charset) throws IOException { return IOs.toString(stream, charset, true); }    }
@Test public void shouldDumpGivenInputStreamContentIntoString() throws IOException { TestInputStream in = new TestInputStream(new ByteArrayInputStream(SOME_STRING_UTF8_BYTES)); String actual = toTest.deserialize(in, UTF8); assertEquals(Values.SOME_STRING, actual); assertTrue(in.hasBeenClosed()); }